core.git: cui/inc

2024-11-04 Thread Ming Hua (via logerrit)
 cui/inc/strings.hrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d1dd3fa84f8eb2c1dc1f34c1ef669cbc5384e5b1
Author: Ming Hua 
AuthorDate: Sun Nov 3 07:09:36 2024 +0200
Commit: Olivier Hallot 
CommitDate: Mon Nov 4 12:26:13 2024 +0100

cui: Fix a UI string in a11y check options

Commit d14e79bf7680db2180e40ba52fc3305a84c586f6 (Correct grammar in
strings for A11y, 2024-09-18) fixed many UI strings in the newly
introduced a11y check options with correct English grammar, but
mistakely changed this string from "heading order" (which means the
chapter and section headings) to "table heading order".

This commit reverts the change and slightly improved the wording.

Change-Id: I2957004d6b82d35841f57a76ca25fbf9b851b9b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175918
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index d7787a44163c..3e204ef7a719 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -427,7 +427,7 @@
 #define STR_NON_INTERACTIVE_FORMS   
NC_("STR_NON_INTERACTIVE_FORMS", "Check if the document contains interactive 
input fields.")
 #define STR_FLOATING_TEXT   NC_("STR_FLOATING_TEXT", 
"Check if all Frames/Text boxes are anchored “As Character”.")
 #define STR_HEADING_IN_TABLE
NC_("STR_HEADING_IN_TABLE", "Check if all tables contain headings.")
-#define STR_HEADING_ORDER   NC_("STR_HEADING_ORDER", 
"Check if the table heading order is correct.")
+#define STR_HEADING_ORDER   NC_("STR_HEADING_ORDER", 
"Check if the headings are in correct order.")
 #define STR_HEADING_START   NC_("STR_HEADING_START", 
"Check if heading order starts with level 1.")
 #define STR_FONTWORKS   NC_("STR_FONTWORKS", 
"Check if the document contains fontwork objects.")
 #define STR_TABLE_FORMATTING
NC_("STR_TABLE_FORMATTING", "Check if document contains empty table cells for 
formatting.")


core.git: sw/inc

2024-11-04 Thread Rosh (via logerrit)
 sw/inc/colwd.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 550abc0f37daf5f78def278de556b2dbb5ddf127
Author: Rosh 
AuthorDate: Mon Nov 4 02:48:06 2024 -0800
Commit: Ilmari Lauhakangas 
CommitDate: Mon Nov 4 13:20:37 2024 +0100

tdf#143148 use pragma once instead of include guards

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

diff --git a/sw/inc/colwd.hxx b/sw/inc/colwd.hxx
index 63d8813b72c2..fe2ec2a2d0a3 100644
--- a/sw/inc/colwd.hxx
+++ b/sw/inc/colwd.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_COLWD_HXX
-#define INCLUDED_SW_INC_COLWD_HXX
+#pragma once
 
 #include 
 #include 
@@ -41,6 +40,4 @@ public:
 void Apply();
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


Re: Damage in macOS Silicon Mac installer for LibreOffice 24.2.7?

2024-11-04 Thread Caolán McNamara
On Sat, 2024-11-02 at 19:39 -0400, Patrick Luby wrote:
> In the official Silicon Mac installation that crashes,
> pthread_mutex_lock() is passed a garbage address. It’s always 0x40 so
> I am guessing that is a data member of some parent class that
> std::mutex holds and that parent instance is a nullptr. It’s as if
> std::mutex is failing to fully initialize itself but only in this one
> official installer. 
> 
> Any theories or ideas welcome.

No idea what is happening there, but I see that m_xPopupMenu in
include/svtools/popupmenucontrollerbase.hxx is a VCLXPopupMenu and it
seems to only need to be a VCLXMenu in case it makes any difference to
use
m_xPopupMenu = dynamic_cast(xPopupMenu.get());
instead of
m_xPopupMenu = dynamic_cast(xPopupMenu.get());
in PopupMenuControllerBase::setPopupMenu


core.git: svx/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 svx/source/gallery2/codec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 910d67e442953f7da669157fe678f764c9623121
Author: Caolán McNamara 
AuthorDate: Mon Nov 4 11:37:13 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 14:06:27 2024 +0100

check stream state

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

diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx
index 19e2a92cb548..76cf35c74023 100644
--- a/svx/source/gallery2/codec.cxx
+++ b/svx/source/gallery2/codec.cxx
@@ -38,7 +38,7 @@ bool GalleryCodec::IsCoded( SvStream& rStm, sal_uInt32& 
rVersion )
 
 rStm.ReadUChar( cByte1 ).ReadUChar( cByte2 ).ReadUChar( cByte3 
).ReadUChar( cByte4 ).ReadUChar( cByte5 ).ReadUChar( cByte6 );
 
-if ( cByte1 == 'S' && cByte2 == 'V' && cByte3 == 'R' && cByte4 == 'L' && 
cByte5 == 'E' && ( cByte6 == '1' || cByte6 == '2' ) )
+if (rStm.good() && cByte1 == 'S' && cByte2 == 'V' && cByte3 == 'R' && 
cByte4 == 'L' && cByte5 == 'E' && ( cByte6 == '1' || cByte6 == '2' ) )
 {
 rVersion = ( ( cByte6 == '1' ) ? 1 : 2 );
 bRet = true;


core.git: sw/source

2024-11-04 Thread Ilmari Lauhakangas (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 182140d53ac767f5f31aefb2f00ac1f812245703
Author: Ilmari Lauhakangas 
AuthorDate: Mon Nov 4 16:17:44 2024 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Mon Nov 4 16:28:51 2024 +0100

Remove commented out includes

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

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index c770415f4a28..8942e812fd29 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -150,9 +150,6 @@
 #include 
 #include 
 
-//#include <../../../../chart2/source/controller/inc/ChartController.hxx>
-//#include 
-
 using namespace ::com::sun::star;
 using namespace com::sun::star::beans;
 using namespace ::com::sun::star::container;


core.git: svx/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 svx/source/gallery2/codec.cxx   |   49 ++--
 svx/source/gallery2/galmisc.cxx |7 -
 2 files changed, 4 insertions(+), 52 deletions(-)

New commits:
commit 6d0a1664d3b0365a0f243669fb2862288a316580
Author: Caolán McNamara 
AuthorDate: Mon Nov 4 11:11:07 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 13:47:59 2024 +0100

delete useless parts of GalleryCodec::Read

no point reading this to just to discard it later

the only places reading this are just opening, using
and close the streams afterwards, so the need
to even skip over this data doesn't seem to arise.

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

diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx
index 5c549bd80173..19e2a92cb548 100644
--- a/svx/source/gallery2/codec.cxx
+++ b/svx/source/gallery2/codec.cxx
@@ -18,6 +18,7 @@
  */
 
 
+#include 
 #include 
 #include 
 #include "codec.hxx"
@@ -84,56 +85,12 @@ void GalleryCodec::Read( SvStream& rStmToRead )
 if( !IsCoded( rStm, nVersion ) )
 return;
 
-sal_uInt32  nCompressedSize, nUnCompressedSize;
-
-rStm.SeekRel( 6 );
-rStm.ReadUInt32( nUnCompressedSize ).ReadUInt32( nCompressedSize );
+rStm.SeekRel( 14 );
 
 // decompress
 if( 1 == nVersion )
 {
-std::unique_ptr pCompressedBuffer(new sal_uInt8[ 
nCompressedSize ]);
-rStm.ReadBytes(pCompressedBuffer.get(), nCompressedSize);
-sal_uInt8*  pInBuf = pCompressedBuffer.get();
-std::unique_ptr pOutBuf(new sal_uInt8[ nUnCompressedSize 
]);
-sal_uInt8*  pTmpBuf = pOutBuf.get();
-sal_uInt8*  pLast = pOutBuf.get() + nUnCompressedSize - 1;
-size_t   nIndex = 0, nCountByte, nRunByte;
-boolbEndDecoding = false;
-
-do
-{
-nCountByte = *pInBuf++;
-
-if ( !nCountByte )
-{
-nRunByte = *pInBuf++;
-
-if ( nRunByte > 2 )
-{
-// filling absolutely
-memcpy( &pTmpBuf[ nIndex ], pInBuf, nRunByte );
-pInBuf += nRunByte;
-nIndex += nRunByte;
-
-// note WORD alignment
-if ( nRunByte & 1 )
-pInBuf++;
-}
-else if ( nRunByte == 1 )   // End of the image
-bEndDecoding = true;
-}
-else
-{
-const sal_uInt8 cVal = *pInBuf++;
-
-memset( &pTmpBuf[ nIndex ], cVal, nCountByte );
-nIndex += nCountByte;
-}
-}
-while ( !bEndDecoding && ( pTmpBuf <= pLast ) );
-
-rStmToRead.WriteBytes(pOutBuf.get(), nUnCompressedSize);
+SAL_WARN("svx", "staroffice binary file formats are no longer 
supported inside the gallery!");
 }
 else if( 2 == nVersion )
 {
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 4d3ef2d5a619..6e80276c3aa6 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -86,12 +86,7 @@ bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel )
 aCodec.Read( aMemStm );
 aMemStm.Seek( 0 );
 
-if( 1 == nVersion )
-{
-OSL_FAIL( "staroffice binary file formats are no longer supported 
inside the gallery!" );
-bRet = false;
-}
-else if( 2 == nVersion )
+if ( 2 == nVersion )
 {
 // recall to read as XML
 bRet = GallerySvDrawImport( aMemStm, rModel );


core.git: svx/source

2024-11-04 Thread Heiko Tietze (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 117bca21b7b068266bb91f1d114e435e0a7ab525
Author: Heiko Tietze 
AuthorDate: Mon Nov 4 14:22:56 2024 +0100
Commit: Heiko Tietze 
CommitDate: Mon Nov 4 15:53:00 2024 +0100

Resolves tdf#160626 - Preserve sorting in SvxStyleToolBoxControl

Inserts now up to 12 default styles and adds only user styles
that are not among the default

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a11ab9a9d041..bcce38e0a52b 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -177,6 +177,11 @@ public:
 m_xWidget->set_entry_text(rText);
 }
 
+int find_text(const OUString& rText)
+{
+return m_xWidget->find_text(rText);
+}
+
 void set_active(int nActive)
 {
 m_xWidget->set_active(nActive);
@@ -3257,15 +3262,14 @@ void SvxStyleToolBoxControl::FillStyleBox()
 {
 if ( aStyles.size() + pBox->get_count() > 12)
 break;
-// insert default style only if not used (and added to rStyle 
before)
-if (std::find(aStyles.begin(), aStyles.end(), rStyle.second) >= 
aStyles.end())
-pBox->append_text(rStyle.second);
+pBox->append_text(rStyle.second);
 }
 }
 std::sort(aStyles.begin(), aStyles.end());
 
 for (const auto& rStyle : aStyles)
-pBox->append_text(rStyle);
+if (pBox->find_text(rStyle) == -1)
+pBox->append_text(rStyle);
 
 if ((pImpl->bSpecModeWriter || pImpl->bSpecModeCalc) && 
!comphelper::LibreOfficeKit::isActive())
 pBox->append_text(pImpl->aMore);


core.git: Branch 'distro/collabora/co-24.04' - sw/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/dochdl/gloshdl.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 8ee5952a13498ed68db00d3ee5dbe88cb0e7af2e
Author: Caolán McNamara 
AuthorDate: Sat Nov 2 20:12:29 2024 +
Commit: Miklos Vajna 
CommitDate: Mon Nov 4 11:47:44 2024 +0100

Drop requirement that there is internal/shared autotext.

A user's autotext was not examined unless there existed some
internal/shared autotext. There seems to be no particular reason
for that, except that internal/shared autotext happens to generally
be available.

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

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index e70ed7ffc4b2..b8d0d1277365 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -373,7 +373,7 @@ bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent)
 if(m_pWrtShell->IsSelection())
 aShortName = m_pWrtShell->GetSelText();
 }
-return pGlossary && Expand(pParent, aShortName, &m_rStatGlossaries, 
std::move(pGlossary));
+return Expand(pParent, aShortName, &m_rStatGlossaries, 
std::move(pGlossary));
 }
 
 bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName,
@@ -386,7 +386,8 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
 // search for text block
 // - don't prefer current group depending on configuration setting
 const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( 
aShortName ) : -1;
+sal_uInt16 nFound = (!rCfg.IsSearchInAllCategories() && pGlossary) ?
+pGlossary->GetIndex( aShortName ) : -1;
 // if not found then search in all groups
 if( nFound == sal_uInt16(-1) )
 {
@@ -397,7 +398,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
 {
 // get group name with path-extension
 const OUString sGroupName = pGlossaryList->GetGroupName(i);
-if(sGroupName == pGlossary->GetName())
+if (pGlossary && sGroupName == pGlossary->GetName())
 continue;
 const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i);
 if(nBlockCount)


core.git: Branch 'distro/collabora/co-24.04' - sw/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/dochdl/gloshdl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 01f0f02246d37b74e33d05b0f3a432fbf4a883aa
Author: Caolán McNamara 
AuthorDate: Sat Nov 2 15:55:14 2024 +
Commit: Miklos Vajna 
CommitDate: Mon Nov 4 11:48:41 2024 +0100

make the autotext shortcut warning dialog async

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

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index b8d0d1277365..cf73a1c62763 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -466,10 +466,10 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
 }
 OUString aTmp( SwResId(STR_NOGLOS));
 aTmp = aTmp.replaceFirst("%1", aShortName);
-std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(m_pWrtShell->GetView().GetFrameWeld(),
+std::shared_ptr 
xInfoBox(Application::CreateMessageDialog(m_pWrtShell->GetView().GetFrameWeld(),
   
VclMessageType::Info, VclButtonsType::Ok,
   aTmp));
-xInfoBox->run();
+xInfoBox->runAsync(xInfoBox, [] (sal_uInt32){ });
 }
 
 return false;


core.git: sw/Library_sw_writerfilter.mk sw/source

2024-11-04 Thread Noel Grandin (via logerrit)
 sw/Library_sw_writerfilter.mk  |1 +
 sw/source/writerfilter/dmapper/PropertyIds.cxx |5 +++--
 sw/source/writerfilter/dmapper/PropertyIds.hxx |2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 81694d9a0082b6c36f3896c6639352cb69266fd1
Author: Noel Grandin 
AuthorDate: Mon Nov 4 14:45:52 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 4 15:18:55 2024 +0100

reduce OUString ref-counting in writerfilter

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

diff --git a/sw/Library_sw_writerfilter.mk b/sw/Library_sw_writerfilter.mk
index f34bdfaad65c..a51650ce9bf2 100644
--- a/sw/Library_sw_writerfilter.mk
+++ b/sw/Library_sw_writerfilter.mk
@@ -46,6 +46,7 @@ $(eval $(call gb_Library_use_libraries,sw_writerfilter,\
 sax \
 sfx \
 sot \
+svl \
 svt \
svxcore \
 sw \
diff --git a/sw/source/writerfilter/dmapper/PropertyIds.cxx 
b/sw/source/writerfilter/dmapper/PropertyIds.cxx
index 75de7b841df8..d2676d56e77a 100644
--- a/sw/source/writerfilter/dmapper/PropertyIds.cxx
+++ b/sw/source/writerfilter/dmapper/PropertyIds.cxx
@@ -17,12 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include 
+#include 
 #include "PropertyIds.hxx"
 #include 
 
 namespace writerfilter::dmapper{
 
-OUString getPropertyName( PropertyIds eId )
+const OUString & getPropertyName( PropertyIds eId )
 {
 static const std::unordered_map constPropertyMap {
 { PROP_CHAR_WEIGHT, u"CharWeight"_ustr},
@@ -402,7 +403,7 @@ OUString getPropertyName( PropertyIds eId )
 if (iterator != constPropertyMap.end())
 return iterator->second;
 
-return OUString();
+return svl::SharedString::EMPTY_STRING;
 }
 
 bool isCharacterProperty( const PropertyIds eId )
diff --git a/sw/source/writerfilter/dmapper/PropertyIds.hxx 
b/sw/source/writerfilter/dmapper/PropertyIds.hxx
index ebc9cdaeede2..277d4139862b 100644
--- a/sw/source/writerfilter/dmapper/PropertyIds.hxx
+++ b/sw/source/writerfilter/dmapper/PropertyIds.hxx
@@ -402,7 +402,7 @@ enum PropertyIds
 };
 
 //Returns the UNO string equivalent to eId.
-OUString getPropertyName(PropertyIds eId);
+const OUString & getPropertyName(PropertyIds eId);
 
 bool isCharacterProperty(const PropertyIds eId);
 


core.git: sfx2/uiconfig

2024-11-04 Thread Heiko Tietze (via logerrit)
 sfx2/uiconfig/ui/descriptioninfopage.ui |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 18ab433bfa00c8a513f3d899f735fb844e2688a4
Author: Heiko Tietze 
AuthorDate: Mon Nov 4 13:41:14 2024 +0100
Commit: Heiko Tietze 
CommitDate: Mon Nov 4 15:02:26 2024 +0100

Resolves tdf#163689 - Long comments must not enlarge properties dialog

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

diff --git a/sfx2/uiconfig/ui/descriptioninfopage.ui 
b/sfx2/uiconfig/ui/descriptioninfopage.ui
index 2a88fd2ee268..1db3fbbac073 100644
--- a/sfx2/uiconfig/ui/descriptioninfopage.ui
+++ b/sfx2/uiconfig/ui/descriptioninfopage.ui
@@ -399,6 +399,7 @@
 True
 True
 True
+word
 
   
 Enter 
comments to help identify the document.


core.git: sw/qa sw/source

2024-11-04 Thread Andreas Heinisch (via logerrit)
 sw/qa/extras/uiwriter/data/tdf153636.odt |binary
 sw/qa/extras/uiwriter/uiwriter8.cxx  |   29 +
 sw/source/core/doc/doctxm.cxx|   19 +++
 3 files changed, 40 insertions(+), 8 deletions(-)

New commits:
commit 2a2c4dddf51c0d6ab726a8854123887bbfa7792a
Author: Andreas Heinisch 
AuthorDate: Tue Oct 29 12:11:41 2024 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Nov 5 07:44:30 2024 +0100

tdf#153636 - Search for outline node only if index is for the current 
chapter

Otherwise, "Use level from source chapter" does not work for Graphics and 
Frames in user-defined indices.

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

diff --git a/sw/qa/extras/uiwriter/data/tdf153636.odt 
b/sw/qa/extras/uiwriter/data/tdf153636.odt
new file mode 100644
index ..d2380120d39e
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf153636.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index de35df5d570e..1c09ab6a9ad6 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2896,6 +2896,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf151462)
 "portion", u"another sub three");
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf153636)
+{
+createSwDoc("tdf153636.odt");
+dispatchCommand(mxComponent, u".uno:UpdateAllIndexes"_ustr, {});
+saveAndReload(u"writer8"_ustr);
+
+xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
+CPPUNIT_ASSERT(pXmlDoc);
+
+for (int i = 1; i <= 3; i += 2)
+{
+const OUString frameStyleName
+= getXPath(pXmlDoc,
+   "/office:document-content/office:body/office:text/"
+   
"text:user-index[@text:name='User-Defined1']/text:index-body/text:p["
+   + OString::number(i) + "]",
+   "style-name");
+const OUString tableStyleName
+= getXPath(pXmlDoc,
+   "/office:document-content/office:body/office:text/"
+   
"text:user-index[@text:name='User-Defined1']/text:index-body/text:p["
+   + OString::number(i + 1) + "]",
+   "style-name");
+
+// Without the fix in place, the frame and table indentation would 
differ
+CPPUNIT_ASSERT_EQUAL(frameStyleName, tableStyleName);
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf157129)
 {
 // Unit test for tdf#157129
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 9f9f245a758c..75b29613d227 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -743,8 +743,9 @@ bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const 
OUString& rName)
 return false;
 }
 
-static const SwTextNode* lcl_FindChapterNode( const SwNode& rNd,
-SwRootFrame const*const pLayout, sal_uInt8 const nLvl = 0 )
+static const SwTextNode* lcl_FindChapterNode(const SwNode& rNd, SwRootFrame 
const* const pLayout,
+ sal_uInt8 const nLvl = 0,
+ const bool bIsFromChapter = true)
 {
 const SwNode* pNd = &rNd;
 if( pNd->GetNodes().GetEndOfExtras().GetIndex() > pNd->GetIndex() )
@@ -759,8 +760,10 @@ static const SwTextNode* lcl_FindChapterNode( const 
SwNode& rNd,
 SwPosition aPos( *pNd );
 pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame );
 OSL_ENSURE( pNd, "Where's the paragraph?" );
-// tdf#151462 - search for outline node containing the current node
-return pNd ? pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 
1, pLayout) : nullptr;
+// tdf#153636 - search for outline node only if the index is for 
the current chapter
+if (bIsFromChapter)
+// tdf#151462 - search for outline node containing the current 
node
+return pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, 
pLayout);
 }
 }
 return pNd->FindOutlineNodeOfLevel(nLvl, pLayout);
@@ -1638,8 +1641,8 @@ void SwTOXBaseSection::UpdateContent( SwTOXElement 
eMyType,
 TOX_ILLUSTRATIONS != SwTOXBase::GetType() &&
 TOX_OBJECTS != SwTOXBase::GetType() )
 {
-const SwTextNode* pOutlNd = ::lcl_FindChapterNode( *pCNd,
-pLayout, MAXLEVEL - 1);
+const SwTextNode* pOutlNd
+= ::lcl_FindChapterNode(*pCNd, pLayout, MAXLEVEL - 1, 
IsFromChapter());
 if( pOutlNd )
 {
 if( 
pOutlNd->GetTextColl()->IsAssignedToListLevelOfOutlineStyle())
@@ -1697,8 +1700,8 @@ void SwTOXBaseSection:

core.git: basic/qa compilerplugins/clang connectivity/source cui/source dbaccess/source desktop/source drawinglayer/source editeng/qa editeng/source i18npool/qa i18npool/source sal/qa sal/rtl sc/qa sc

2024-11-04 Thread Noel Grandin (via logerrit)
 basic/qa/cppunit/test_scanner.cxx |   28 ++--
 compilerplugins/clang/staticconstexpr.cxx |   91 ++
 compilerplugins/clang/test/staticconstexpr.cxx|   28 
 connectivity/source/parse/sqlnode.cxx |2 
 cui/source/options/optgdlg.cxx|2 
 dbaccess/source/core/api/KeySet.cxx   |4 
 dbaccess/source/filter/hsqldb/createparser.cxx|2 
 dbaccess/source/ui/browser/unodatbr.cxx   |4 
 dbaccess/source/ui/dlg/tablespage.cxx |2 
 desktop/source/app/app.cxx|4 
 drawinglayer/source/processor2d/cairopixelprocessor2d.cxx |8 -
 editeng/qa/unit/core-test.cxx |   16 +-
 editeng/source/items/numitem.cxx  |4 
 i18npool/qa/cppunit/test_breakiterator.cxx|8 -
 i18npool/source/collator/collator_unicode.cxx |2 
 sal/qa/osl/socket.cxx |2 
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx   |2 
 sal/qa/rtl/strings/test_strings_defaultstringview.cxx |3 
 sal/qa/rtl/textenc/rtl_textcvt.cxx|2 
 sal/rtl/strtmpl.hxx   |2 
 sc/qa/unit/subsequent_export_test.cxx |   15 +-
 sc/qa/unit/subsequent_export_test2.cxx|6 
 sc/qa/unit/subsequent_export_test4.cxx|2 
 sc/qa/unit/subsequent_filters_test3.cxx   |4 
 sc/qa/unit/subsequent_filters_test5.cxx   |4 
 sc/qa/unit/tiledrendering/tiledrendering.cxx  |2 
 sc/qa/unit/ucalc_copypaste.cxx|4 
 sc/qa/unit/ucalc_formula.cxx  |2 
 sc/qa/unit/ucalc_formula2.cxx |   10 -
 sc/qa/unit/ucalc_parallelism.cxx  |2 
 sc/qa/unit/uicalc/uicalc2.cxx |2 
 sc/source/core/tool/compiler.cxx  |2 
 sc/source/ui/dbgui/scuiasciiopt.cxx   |2 
 sc/source/ui/docshell/impex.cxx   |2 
 sd/qa/unit/export-tests-ooxml1.cxx|2 
 sd/qa/unit/export-tests.cxx   |3 
 sd/qa/unit/layout-tests.cxx   |2 
 sdext/source/pdfimport/wrapper/wrapper.cxx|2 
 sfx2/source/control/dispatch.cxx  |2 
 sfx2/source/dialog/StyleList.cxx  |6 
 solenv/CompilerTest_compilerplugins_clang.mk  |1 
 svl/qa/unit/svl.cxx   |2 
 svl/qa/unit/test_lngmisc.cxx  |2 
 svx/qa/unit/gallery/test_gallery.cxx  |6 
 svx/source/tbxctrls/tbcontrl.cxx  |2 
 sw/qa/core/test_ToxWhitespaceStripper.cxx |2 
 sw/qa/extras/htmlexport/htmlexport.cxx|6 
 sw/qa/extras/odfexport/odfexport.cxx  |2 
 sw/qa/extras/odfexport/odfexport2.cxx |2 
 sw/qa/extras/ooxmlexport/ooxmlexport20.cxx|3 
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |2 
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |2 
 sw/qa/extras/uiwriter/uiwriter3.cxx   |6 
 sw/qa/extras/uiwriter/uiwriter4.cxx   |   10 -
 sw/qa/extras/uiwriter/uiwriter6.cxx   |2 
 sw/qa/extras/uiwriter/uiwriter7.cxx   |4 
 sw/source/core/doc/DocumentContentOperationsManager.cxx   |2 
 sw/source/core/doc/DocumentRedlineManager.cxx |2 
 sw/source/filter/html/css1atr.cxx |2 
 sw/source/filter/ww8/docxexport.cxx   |2 
 sw/source/filter/ww8/rtfexport.cxx|2 
 sw/source/filter/ww8/ww8par2.cxx  |4 
 sw/source/filter/ww8/ww8par3.cxx  |2 
 sw/source/uibase/dbui/dbui.cxx|4 
 sw/source/uibase/shells/textsh1.cxx   |2 
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx  |4 
 tools/qa/cppunit/test_rectangle.cxx   |   24 +--
 tools/qa/cppunit/test_stream.cxx  |2 
 tools/source/generic/bigint.cxx   |4 
 vcl/qa/cppunit/pdfexport/pdfexport2.cxx   |   12 -
 vcl/skia/gdiimpl.cxx  |2 
 vcl/skia/salbmp.cxx   |   24 +--
 vcl/source/app/svmain.cxx |2 
 writerperfect/qa/unit/EPUBExportTest.cxx  |2 
 xml

core.git: 2 commits - sal/osl sw/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 sal/osl/unx/pipe.cxx|5 +
 sw/source/uibase/dochdl/gloshdl.cxx |7 ---
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 88fe9c4903f65593785b3895e43e4e3ee17ba2f3
Author: Caolán McNamara 
AuthorDate: Sat Nov 2 20:12:29 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:39:04 2024 +0100

Drop requirement that there is internal/shared autotext.

A user's autotext was not examined unless there existed some
internal/shared autotext. There seems to be no particular reason
for that, except that internal/shared autotext happens to generally
be available.

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

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index 2e52e68b95d4..7706bf899b80 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -383,7 +383,7 @@ bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent)
 if(m_pWrtShell->IsSelection())
 aShortName = m_pWrtShell->GetSelText();
 }
-return pGlossary && Expand(pParent, aShortName, &m_rStatGlossaries, 
std::move(pGlossary));
+return Expand(pParent, aShortName, &m_rStatGlossaries, 
std::move(pGlossary));
 }
 
 bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName,
@@ -396,7 +396,8 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
 // search for text block
 // - don't prefer current group depending on configuration setting
 const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( 
aShortName ) : USHRT_MAX;
+sal_uInt16 nFound = (!rCfg.IsSearchInAllCategories() && pGlossary) ?
+pGlossary->GetIndex( aShortName ) : USHRT_MAX;
 // if not found then search in all groups
 if (nFound == USHRT_MAX)
 {
@@ -407,7 +408,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
 {
 // get group name with path-extension
 const OUString sGroupName = pGlossaryList->GetGroupName(i);
-if(sGroupName == pGlossary->GetName())
+if (pGlossary && sGroupName == pGlossary->GetName())
 continue;
 const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i);
 if(nBlockCount)
commit 910ae381bd97df03eaeb0822f56c1f8cec7ac594
Author: Caolán McNamara 
AuthorDate: Wed Aug 21 21:41:45 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:38:52 2024 +0100

merge creating variable and assigning it

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

diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index c485f8da27f3..b683e17b2623 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -478,10 +478,7 @@ sal_Int32 SAL_CALL osl_writePipe(oslPipe pPipe, const void 
*pBuffer, sal_Int32 n
 SAL_WARN_IF(!pPipe, "sal.osl.pipe", "osl_writePipe: invalid pipe"); // 
osl_sendPipe detects invalid pipe
 while (BytesToSend > 0)
 {
-sal_Int32 RetVal;
-
-RetVal= osl_sendPipe(pPipe, pBuffer, BytesToSend);
-
+sal_Int32 RetVal = osl_sendPipe(pPipe, pBuffer, BytesToSend);
 /* error occurred? */
 if (RetVal <= 0)
 break;


core.git: 2 commits - comphelper/source desktop/source

2024-11-04 Thread Skyler Grey (via logerrit)
 comphelper/source/misc/sequenceashashmap.cxx |8 
 desktop/source/lib/init.cxx  |4 
 2 files changed, 12 insertions(+)

New commits:
commit 3a9caad863554b1a3465e9eb898f55f516c378d1
Author: Skyler Grey 
AuthorDate: Wed Oct 9 16:29:30 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:39:27 2024 +0100

feat(json): Allow serializing any

Previously, as far as I can tell, there was no way to send a Size in a
.uno command (as would be needed in, say, '.uno:InsertAVMedia').

We do, however, already have a way to send an `[]any`, and we can use a
similar method to allow sending arbitrary types with `any` rather than
`[]any`.

To use this, the type you really want to send has to be wrapped in any,
so for example...

{
  type: "any",
  value: {
type: "com.sun.star.awt.Size",
value: {
  Width: {
type: "long",
value: 0,
  },
  Height: {
type: "long",
value: 0,
  }
}
  }
}

Change-Id: Ic33594dee955d475d81733adb21950c0458435e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174740
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 
(cherry picked from commit cccbf8608f3b76651993bc8576c672367c228fa2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175982
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/comphelper/source/misc/sequenceashashmap.cxx 
b/comphelper/source/misc/sequenceashashmap.cxx
index 9f8655f3d164..651f1ee4aad9 100644
--- a/comphelper/source/misc/sequenceashashmap.cxx
+++ b/comphelper/source/misc/sequenceashashmap.cxx
@@ -347,6 +347,14 @@ static std::vector 
JsonToPropertyValues(const boost::
 aValue.Value <<= aSeqByte;
 }
 }
+else if (rType == "any")
+{
+aNodeValue = rPair.second.get_child("value", aNodeNull);
+if (aNodeValue != aNodeNull && !aNodeValue.empty())
+{
+aValue.Value = jsonToUnoAny(aNodeValue);
+}
+}
 else if (rType == "[]any")
 {
 aNodeValue = rPair.second.get_child("value", aNodeNull);
commit eeb72ef257742e9d67927e976779468a78f1d402
Author: Skyler Grey 
AuthorDate: Tue Oct 1 09:17:49 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:39:18 2024 +0100

feat(lok): Add extra impress export formats

Previously we had the ability to export to various formats, but these
weren't exposed in a way that LOK could request them. We want to
increase the options available for export, so we need to make these
available.

Change-Id: I1c05aeec8de32929481059bcfd02cac05a46788d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174602
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 541272d3eaa322ccdd1b926add031a39faeccf49)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175981
Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1e667eeb76b0..7f804585813e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -365,6 +365,10 @@ constexpr ExtensionMap aImpressExtensionMap[] =
 { "svg",   u"impress_svg_Export"_ustr },
 { "xhtml", u"XHTML Impress File"_ustr },
 { "png",   u"impress_png_Export"_ustr },
+{ "bmp",   u"impress_bmp_Export"_ustr },
+{ "gif",   u"impress_gif_Export"_ustr },
+{ "tif",   u"impress_tif_Export"_ustr },
+{ "tiff",  u"impress_tif_Export"_ustr }, // tif and tiff are the same 
format: see 
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types#tiff_tagged_image_file_format
 };
 
 constexpr ExtensionMap aDrawExtensionMap[] =


core.git: 3 commits - sc/source tools/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/interpr3.cxx |1 +
 sc/source/filter/excel/impop.cxx |7 +++
 tools/source/generic/config.cxx  |   16 +---
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 051365a71fa51f8ef01a4c91a83f3e38472be58f
Author: Caolán McNamara 
AuthorDate: Fri Nov 1 09:46:58 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:38:46 2024 +0100

cid#1606943 Overflowed constant

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

diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 00b3aef2c2c7..9fa470b854ba 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -255,7 +255,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
 assert(nLineLen > 0);
 nLineLen--;
 // remove spaces and tabs
-while ( (*pLine == ' ') || (*pLine == '') )
+while ( nLineLen > 0 && (*pLine == ' ' || *pLine == '  ') )
 {
 nLineLen--;
 pLine++;
@@ -263,11 +263,8 @@ static void ImplMakeConfigList( ImplConfigData* pData,
 nNameLen = 0;
 while ( (nNameLen < nLineLen) && (pLine[nNameLen] != ']') )
 nNameLen++;
-if ( nNameLen )
-{
-while ( (pLine[nNameLen-1] == ' ') || (pLine[nNameLen-1] == '  
') )
-nNameLen--;
-}
+while ( nNameLen > 0 && (pLine[nNameLen-1] == ' ' || 
pLine[nNameLen-1] == '') )
+nNameLen--;
 pGroup->maGroupName = makeOString(pLine, nNameLen);
 }
 else
@@ -320,11 +317,8 @@ static void ImplMakeConfigList( ImplConfigData* pData,
 nNameLen++;
 nKeyLen = nNameLen;
 // Remove spaces and tabs
-if ( nNameLen )
-{
-while ( (pLine[nNameLen-1] == ' ') || 
(pLine[nNameLen-1] == '  ') )
-nNameLen--;
-}
+while ( nNameLen > 0 && (pLine[nNameLen-1] == ' ' || 
pLine[nNameLen-1] == '') )
+nNameLen--;
 pKey->maKey = makeOString(pLine, nNameLen);
 nKeyLen++;
 if ( nKeyLen < nLineLen )
commit 5bca5b23b783bf20b0a030bab0e5b678e811a4a3
Author: Caolán McNamara 
AuthorDate: Fri Oct 18 21:20:52 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:38:38 2024 +0100

cid#1606699 silence Overflowed constant

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

diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index bc6a904c589c..4263f5deb9c7 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -241,9 +241,8 @@ void ImportExcel::ReadDimensions()
 }
 else
 {
-sal_uInt32 nXclRow1 = 0, nXclRow2 = 0;
-nXclRow1 = maStrm.ReaduInt32();
-nXclRow2 = maStrm.ReaduInt32();
+sal_uInt32 nXclRow1 = maStrm.ReaduInt32();
+sal_uInt32 nXclRow2 = maStrm.ReaduInt32();
 aXclUsedArea.maFirst.mnCol = maStrm.ReaduInt16();
 aXclUsedArea.maLast.mnCol = maStrm.ReaduInt16();
 if( nXclRow2 != 0 && (nXclRow1 < nXclRow2) && 
(aXclUsedArea.GetColCount() > 1) &&
@@ -251,7 +250,7 @@ void ImportExcel::ReadDimensions()
 {
 // Excel stores first unused row/column index
 --nXclRow2;
---aXclUsedArea.maLast.mnCol;
+aXclUsedArea.maLast.mnCol = 
o3tl::sanitizing_dec(aXclUsedArea.maLast.mnCol);
 // convert row indexes to 16-bit values
 aXclUsedArea.maFirst.mnRow = static_cast< sal_uInt16 >( nXclRow1 );
 aXclUsedArea.maLast.mnRow = limit_cast< sal_uInt16 >( nXclRow2, 
aXclUsedArea.maFirst.mnRow, SAL_MAX_UINT16 );
commit 3c1b7e4fe7146f51afe1205b16a4063d73f93055
Author: Caolán McNamara 
AuthorDate: Fri Nov 1 20:30:47 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 09:38:32 2024 +0100

cid#1607290 silence Overflowed constant

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

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 6f66cd431db1..59787aba62f7 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -1458,6 +1458,7 @@ void ScInterpreter::ScCritBinom()
 return;
 }
 }
+assert(i > 0 && "coverity 2023.12.

core.git: Branch 'feature/cib_contract49d' - framework/source vcl/win

2024-11-04 Thread Tibor Nagy (via logerrit)
 framework/source/loadenv/loadenv.cxx |8 +---
 vcl/win/window/salframe.cxx  |4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit d6b5378c66b81b8af604dd65306541a572d3
Author: Tibor Nagy 
AuthorDate: Sun Oct 27 23:44:00 2024 +0100
Commit: Nagy Tibor 
CommitDate: Mon Nov 4 10:26:28 2024 +0100

tdf#76981 sd: Hide the document opening process when opening linked

presentation in slideshow mode, only the presentation should be visible.
The user should not see any intermediate loading processes or windows,
providing a seamless transition directly to the presentation content.
After closing the opened presentation, the running presentation should 
receive focus.

Change-Id: Idc24de3d38523f044d7969f1eacb05c6bae91b83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175706
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 
(cherry picked from commit d239ac793f89c95cac95e5601a7d7a06c76dfd3c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175905
Tested-by: allotropia jenkins 

diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 299b0fcd5ba4..f95dd85c32c9 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -159,7 +159,6 @@ css::uno::Reference< css::lang::XComponent > 
LoadEnv::loadComponentFromURL(const
 try
 {
 LoadEnv aEnv(xContext);
-
 LoadEnvFeatures loadEnvFeatures = LoadEnvFeatures::WorkWithUI;
 // tdf#118238 Only disable UI interaction when loading as hidden
 if (comphelper::NamedValueCollection::get(lArgs, u"Hidden") == 
uno::Any(true) || Application::IsHeadlessModeEnabled())
@@ -1103,8 +1102,9 @@ bool LoadEnv::impl_loadContent()
 bool bHidden= 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN, 
false);
 bool bMinimized = 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED,
 false);
 bool bPreview   = 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW,
 false);
+bool bStartPres = m_lMediaDescriptor.contains("StartPresentation");
 
-if (!bHidden && !bMinimized && !bPreview)
+if (!bHidden && !bMinimized && !bPreview && !bStartPres)
 {
 css::uno::Reference xProgress = 
m_lMediaDescriptor.getUnpackedValueOrDefault(
 utl::MediaDescriptor::PROP_STATUSINDICATOR, 
css::uno::Reference());
@@ -1596,6 +1596,8 @@ void LoadEnv::impl_reactForLoadingState()
 css::uno::Reference< css::awt::XWindow > xWindow  = 
m_xTargetFrame->getContainerWindow();
 bool bHidden  = 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN, 
false);
 bool bMinimized = 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED,
 false);
+bool bStartPres = 
m_lMediaDescriptor.contains("StartPresentation");
+
 VclPtr pWindow = VCLUnoHelper::GetWindow(xWindow);
 
 if (bMinimized)
@@ -1605,7 +1607,7 @@ void LoadEnv::impl_reactForLoadingState()
 if (pWindow && pWindow->IsSystemWindow())
 static_cast(pWindow.get())->Minimize();
 }
-else if (!bHidden)
+else if (!bHidden && !bStartPres)
 {
 // show frame ... if it's not still visible ...
 // But do nothing if it's already visible!
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 783ca27192c6..c26070ac078e 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -813,8 +813,8 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* 
pFrame,
 }
 nScreenX = aRect.Left();
 nScreenY = aRect.Top();
-nScreenDX = aRect.GetWidth();
-nScreenDY = aRect.GetHeight();
+nScreenDX = aRect.GetWidth() + 1;
+nScreenDY = aRect.GetHeight() + 1;
 }
 catch( Exception& )
 {


core.git: Branch 'feature/cib_contract49d' - sc/source

2024-11-04 Thread Stephan Bergmann (via logerrit)
 sc/source/core/data/table1.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit cb2f07179a054c4bd4ca9e927f73647dcab31b9a
Author: Stephan Bergmann 
AuthorDate: Tue Oct 29 14:48:24 2024 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Nov 5 02:00:04 2024 +0100

Missing initialization of ScTable::mbTotalsRowBelow

...introduced in 26c08356d1b2a963efdca570979cb04388371400 "tdf#162262 sc add
"Summary below data" option for Subtotal dialog"

Follow up commit: 26c08356d1b2a963efdca570979cb04388371400
(tdf#162262 sc add "Summary below data" option for Subtotal dialog)

Change-Id: I9d8e12fc24e6e42f6ee28c4879ddcff497b88c18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175793
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175812
Tested-by: allotropia jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index f90c4a73e011..d6f910d9867d 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -282,6 +282,7 @@ ScTable::ScTable( ScDocument& rDoc, SCTAB nNewTab, const 
OUString& rNewName,
 bActiveScenario(false),
 mbPageBreaksValid(false),
 mbForceBreaks(false),
+mbTotalsRowBelow(true),
 bStreamValid(false)
 {
 aDefaultColData.InitAttrArray(new ScAttrArray(static_cast(-1), 
nNewTab, rDoc, nullptr));


core.git: Branch 'feature/cib_contract49d' - 3 commits - compilerplugins/clang connectivity/source include/o3tl lotuswordpro/source offapi/com oox/source sc/inc sc/qa sc/source sc/uiconfig sw/source

2024-11-04 Thread Balazs Varga (via logerrit)
 compilerplugins/clang/test/writeonlyvars.cxx |1 
 connectivity/source/drivers/dbase/DIndexIter.cxx |3 
 include/o3tl/safeint.hxx |   36 +
 lotuswordpro/source/filter/lwptablelayout.cxx|2 
 offapi/com/sun/star/sheet/Spreadsheet.idl|   13 +
 oox/source/token/properties.txt  |1 
 sc/inc/document.hxx  |2 
 sc/inc/subtotalparam.hxx |1 
 sc/inc/table.hxx |4 
 sc/inc/unonames.hxx  |1 
 sc/inc/unowids.hxx   |3 
 sc/qa/uitest/data/tdf162262.ods  |binary
 sc/qa/uitest/sort/subtotals.py   |  109 
 sc/qa/unit/data/xlsx/subtotal-above.xlsx |binary
 sc/qa/unit/subsequent_export_test4.cxx   |   12 +
 sc/source/core/data/document.cxx |   23 +++
 sc/source/core/data/subtotalparam.cxx|6 
 sc/source/core/data/table3.cxx   |   92 +
 sc/source/filter/excel/excdoc.cxx|3 
 sc/source/filter/excel/excrecds.cxx  |   10 -
 sc/source/filter/inc/excrecds.hxx|3 
 sc/source/filter/oox/worksheetsettings.cxx   |6 
 sc/source/ui/dbgui/tpsubt.cxx|6 
 sc/source/ui/inc/tpsubt.hxx  |1 
 sc/source/ui/unoobj/cellsuno.cxx |6 
 sc/source/ui/view/cellsh1.cxx|6 
 sc/uiconfig/scalc/ui/subtotaloptionspage.ui  |  152 +--
 sw/source/ui/index/cnttab.cxx|2 
 28 files changed, 396 insertions(+), 108 deletions(-)

New commits:
commit b5347e43505f132caa3f2dee0156b6c10df07b4c
Author: Balazs Varga 
AuthorDate: Thu Oct 24 14:17:46 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Nov 4 23:57:03 2024 +0100

tdf#162262 sc add "Summary below data" option for Subtotal dialog

With this option we can set where the summary rows should appear,
above or below the datas when we create a new Subtotal area. The default
option is "True" (which means the summary rows are below the datas)
when we create a new subtotal area. Unless if we already have one subtotal
area on the same sheet, in that case the sheet level property, 
"TotalsRowBelow"
contains where should the summary rows be for the new Subtotal's.

TODO: add new ODF xml attribute for Summary below

Change-Id: Icf86c85041d75c24919cb528846d5bb2b517ca78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175556
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/offapi/com/sun/star/sheet/Spreadsheet.idl 
b/offapi/com/sun/star/sheet/Spreadsheet.idl
index d1a1dfcd0f18..605055c7b4ec 100644
--- a/offapi/com/sun/star/sheet/Spreadsheet.idl
+++ b/offapi/com/sun/star/sheet/Spreadsheet.idl
@@ -169,6 +169,19 @@ service Spreadsheet
 /** specifies all conditional formats of that sheet
  */
 [optional, property] com::sun::star::sheet::XConditionalFormats 
ConditionalFormats;
+
+/** specifies whether summary rows appear below detail in an outline,
+when applying an outline.
+
+ When true a summary row is inserted below the detailed data being
+summarized and a new outline level is established on that row.
+
+ When false a summary row is inserted above the detailed data being
+summarized and a new outline level is established on that row.
+
+@since LibreOffice 25.2
+*/
+[optional, property] boolean TotalsRowBelow;
 };
 
 
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index fd78234fbd0e..60dd62d7c6cc 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -608,6 +608,7 @@ TopBorderComplexColor
 TopBorderDistance
 TopMargin
 TotalsRow
+TotalsRowBelow
 Transformation
 TransitionDirection
 TransitionDuration
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 15f1720142fb..f8102da7bb68 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -913,6 +913,8 @@ public:
 SC_DLLPUBLIC bool GetName( SCTAB nTab, OUString& rName ) const;
 SC_DLLPUBLIC bool GetCodeName( SCTAB nTab, OUString& rName ) const;
 SC_DLLPUBLIC bool SetCodeName( SCTAB nTab, const OUString& rName );
+SC_DLLPUBLIC bool GetTotalsRowBelow( SCTAB nTab ) const;
+SC_DLLPUBLIC bool SetTotalsRowBelow( SCTAB nTab, bool bVal );
 SC_DLLPUBLIC bool GetTable( const OUString& rName, SCTAB& rTab ) const;
 SC_DLLPUBLIC SCCOL MaxCol() const { return mxSheetLimits->mnMaxCol; }
 SC_DLLPUBLIC SCROW MaxRow() const { return mxSheetLimits->mnMaxRow; }
diff --git a/sc/inc/subtotalparam.hxx b/sc/inc/subtotalparam.hxx
index 8e36dad83987..3b379edb167d 100644
--- a/sc/inc/subtotalparam.hxx
+++ b/sc/inc/subtotalparam.hxx
@@ -24,6 +24,7 @@ struct SC_DLLPUBLIC ScSubTotalParam
 boolbPagebr

core.git: sw/source

2024-11-04 Thread Bogdan Buzea (via logerrit)
 sw/source/ui/fldui/fldvar.cxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit 22297112c55bc907a8f0b798e0fc7fd5812567c0
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 11:37:00 2024 +0200
Commit: David Gilbert 
CommitDate: Mon Nov 4 22:43:09 2024 +0100

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 767, 
777

Change-Id: Ie9a6d6376f5037ee075c95e62c2c7970b720e9a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175309
Tested-by: Jenkins
Reviewed-by: David Gilbert 

diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 6b2bb3eb7c5b..52c045b9af7d 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -763,15 +763,6 @@ void SwFieldVarPage::FillFormatLB(SwFieldTypesEnum nTypeId)
 break;
 
 case SwFieldTypesEnum::Formel:
-{
-OUString sId(OUString::number(NUMBERFORMAT_ENTRY_NOT_FOUND));
-int nOldIndex = rWidget.get_selected_index();
-rWidget.insert(0, SwResId(FMT_GETVAR_NAME), &sId, nullptr, 
nullptr);
-if (nOldIndex != -1)
-rWidget.select(nOldIndex + 1);
-}
-break;
-
 case SwFieldTypesEnum::Get:
 {
 OUString sId(OUString::number(NUMBERFORMAT_ENTRY_NOT_FOUND));


core.git: starmath/source

2024-11-04 Thread Bogdan Buzea (via logerrit)
 starmath/source/mathml/mathmlimport.cxx |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit e877bd2a25b391244abff329a83d8a2b0c656493
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 12:02:02 2024 +0200
Commit: David Gilbert 
CommitDate: Mon Nov 4 22:46:50 2024 +0100

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 574, 
577
V1037 Two or more case-branches perform the same actions. Check lines: 738, 
752, 759
V1037 Two or more case-branches perform the same actions. Check lines: 
1949, 1953

Change-Id: I2a6b6cc16ff58d432e5a7b14a6a1d7fa4f1a15b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175313
Tested-by: Jenkins
Reviewed-by: David Gilbert 

diff --git a/starmath/source/mathml/mathmlimport.cxx 
b/starmath/source/mathml/mathmlimport.cxx
index 4a0ac6a438e2..91bc834a27b0 100644
--- a/starmath/source/mathml/mathmlimport.cxx
+++ b/starmath/source/mathml/mathmlimport.cxx
@@ -571,8 +571,6 @@ void SmXMLContext_Helper::RetrieveAttrs(
 sFontFamily = aIter.toString();
 break;
 case XML_COLOR:
-sColor = aIter.toString();
-break;
 case XML_MATHCOLOR:
 sColor = aIter.toString();
 break;
@@ -735,6 +733,10 @@ void 
SmXMLTokenAttrHelper::ApplyAttrs(MathMLMathvariantValue eDefaultMv)
 vVariant.push_back(TNITALIC);
 break;
 case MathMLMathvariantValue::Bold:
+case MathMLMathvariantValue::BoldFraktur:
+// TODO: Fraktur
+case MathMLMathvariantValue::BoldScript:
+// TODO: Script
 vVariant.push_back(TBOLD);
 break;
 case MathMLMathvariantValue::Italic:
@@ -747,17 +749,9 @@ void 
SmXMLTokenAttrHelper::ApplyAttrs(MathMLMathvariantValue eDefaultMv)
 case MathMLMathvariantValue::DoubleStruck:
 // TODO
 break;
-case MathMLMathvariantValue::BoldFraktur:
-// TODO: Fraktur
-vVariant.push_back(TBOLD);
-break;
 case MathMLMathvariantValue::Script:
 // TODO
 break;
-case MathMLMathvariantValue::BoldScript:
-// TODO: Script
-vVariant.push_back(TBOLD);
-break;
 case MathMLMathvariantValue::Fraktur:
 // TODO
 break;
@@ -1946,8 +1940,6 @@ uno::Reference 
SmXMLDocContext_Impl::createFastCh
 {
 //Consider semantics a dummy except for any starmath annotations
 case XML_ELEMENT(MATH, XML_SEMANTICS):
-xContext = new SmXMLRowContext_Impl(GetSmImport());
-break;
 /*General Layout Schemata*/
 case XML_ELEMENT(MATH, XML_MROW):
 xContext = new SmXMLRowContext_Impl(GetSmImport());


core.git: sw/source

2024-11-04 Thread Bogdan Buzea (via logerrit)
 sw/source/writerfilter/dmapper/NumberingManager.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit f0d1b3a0a3708864cdea1c04e90f666984b28575
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 11:39:11 2024 +0200
Commit: David Gilbert 
CommitDate: Mon Nov 4 22:48:27 2024 +0100

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 764, 
767

Change-Id: Ia8da107d28249132b92e7cf533505b09c0037188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175310
Tested-by: Jenkins
Reviewed-by: David Gilbert 

diff --git a/sw/source/writerfilter/dmapper/NumberingManager.cxx 
b/sw/source/writerfilter/dmapper/NumberingManager.cxx
index 576a0caa4cce..d5d81d47b94b 100644
--- a/sw/source/writerfilter/dmapper/NumberingManager.cxx
+++ b/sw/source/writerfilter/dmapper/NumberingManager.cxx
@@ -760,10 +760,8 @@ void ListsManager::lcl_attribute( Id nName, const Value& 
rVal )
 AbstractListDef::SetValue( nName );
 break;
 case NS_ooxml::LN_CT_NumLvl_ilvl:
-//add a new level to the level vector and make it the current one
-m_pCurrentDefinition->AddLevel(rVal.getString().toUInt32());
-break;
 case NS_ooxml::LN_CT_Lvl_ilvl:
+//add a new level to the level vector and make it the current one
 m_pCurrentDefinition->AddLevel(rVal.getString().toUInt32());
 break;
 case NS_ooxml::LN_CT_AbstractNum_abstractNumId:


core.git: sc/source

2024-11-04 Thread Bogdan Buzea (via logerrit)
 sc/source/filter/excel/xeescher.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 9a917ff65690b00cebb53f0c67bd91622a33351f
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 11:34:03 2024 +0200
Commit: David Gilbert 
CommitDate: Mon Nov 4 22:49:22 2024 +0100

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 778, 
793

Change-Id: I2437bbac1bc952720d4ea3c43107c9d5e1ef1655
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175308
Tested-by: Jenkins
Reviewed-by: David Gilbert 

diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 7b23e9755162..61d0fc185433 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -775,6 +775,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( 
XclExpObjectManager& rRoot, Reference<
 break;
 // Push button cannot be set to flat in Excel
 case FormCompType::COMMANDBUTTON:
+// Group box does not support flat style (#i34712#)
+case FormCompType::GROUPBOX:
 nApiBorder = AwtVisualEffect::LOOK3D;
 break;
 // Label does not support a border in Excel
@@ -788,10 +790,6 @@ XclExpTbxControlObj::XclExpTbxControlObj( 
XclExpObjectManager& rRoot, Reference<
 nApiButton = AwtVisualEffect::LOOK3D;
 nApiBorder = AwtVisualEffect::NONE;
 break;
-// Group box does not support flat style (#i34712#)
-case FormCompType::GROUPBOX:
-nApiBorder = AwtVisualEffect::LOOK3D;
-break;
 }
 mbFlatButton = nApiButton != AwtVisualEffect::LOOK3D;
 mbFlatBorder = nApiBorder != AwtVisualEffect::LOOK3D;


core.git: reportdesign/source

2024-11-04 Thread Bogdan Buzea (via logerrit)
 reportdesign/source/ui/inspection/GeometryHandler.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 84f85e8ad10ce1913dd530a85fee22cbc4d11ea7
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 16:14:54 2024 +0200
Commit: David Gilbert 
CommitDate: Mon Nov 4 22:50:54 2024 +0100

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 734, 
739
V1037 Two or more case-branches perform the same actions. Check lines: 
1031, 1054

Change-Id: I835ac504eadcbdd44b2ee507f40e6f40ff5e416d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175318
Reviewed-by: David Gilbert 
Tested-by: Jenkins

diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx 
b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 8ec61ceaca5e..a2a731777cd9 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -731,10 +731,6 @@ inspection::LineDescriptor SAL_CALL 
GeometryHandler::describePropertyLine(const
 break;
 case PROPERTY_ID_INITIALFORMULA:
 case PROPERTY_ID_FORMULA:
-aOut.PrimaryButtonId = UID_RPT_PROP_FORMULA;
-aOut.HasPrimaryButton = true;
-aOut.Control = 
_xControlFactory->createPropertyControl(inspection::PropertyControlType::MultiLineTextField
 , false);
-break;
 case PROPERTY_ID_CONDITIONALPRINTEXPRESSION:
 aOut.PrimaryButtonId = UID_RPT_PROP_FORMULA;
 aOut.HasPrimaryButton = true;
@@ -1028,6 +1024,7 @@ uno::Any SAL_CALL 
GeometryHandler::convertToPropertyValue(const OUString & Prope
 case PROPERTY_ID_SCOPE:
 case PROPERTY_ID_FORMULALIST:
 case PROPERTY_ID_AREA:
+case PROPERTY_ID_MIMETYPE:
 aPropertyValue = _rControlValue;
 break;
 case PROPERTY_ID_TYPE:
@@ -1050,9 +1047,6 @@ uno::Any SAL_CALL 
GeometryHandler::convertToPropertyValue(const OUString & Prope
 aPropertyValue <<= nFound;
 }
 break;
-case PROPERTY_ID_MIMETYPE:
-aPropertyValue = _rControlValue;
-break;
 case PROPERTY_ID_VERTICALALIGN:
 {
 OUString sValue;


core.git: sw/source

2024-11-04 Thread Bogdan Buzea (via logerrit)
 sw/source/core/fields/reffld.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 9e3803ae438ddcf91ec0e15431be379561d28ba6
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 17:29:49 2024 +0200
Commit: David Gilbert 
CommitDate: Mon Nov 4 22:51:37 2024 +0100

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 609, 
637

Change-Id: I4376e86a5484886025152a9a407b23b3d05c3911
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175355
Tested-by: Jenkins
Reviewed-by: David Gilbert 

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 8ca0cce869e1..e994dabfab17 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -606,6 +606,7 @@ void SwGetRefField::UpdateField(const SwTextField* 
pFieldTextAttr, SwFrame* pFra
 break;
 
 case REF_OUTLINE:
+case REF_SETREFATTR:
 nStart = nNumStart;
 nEnd = nNumEnd;
 break;
@@ -633,11 +634,6 @@ void SwGetRefField::UpdateField(const SwTextField* 
pFieldTextAttr, SwFrame* pFra
 nEnd = nLen;
 break;
 
-case REF_SETREFATTR:
-nStart = nNumStart;
-nEnd = nNumEnd;
-break;
-
 default:
 O3TL_UNREACHABLE;
 }


core.git: 3 commits - vcl/inc vcl/Library_vcl.mk vcl/source

2024-11-04 Thread Tomaž Vajngerl (via logerrit)
 vcl/Library_vcl.mk   |   12 
 vcl/inc/pdf/EncryptionHashTransporter.hxx|   56 +++
 vcl/inc/pdf/PDFEncryptor.hxx |   85 +
 vcl/inc/pdf/pdfwriter_impl.hxx   |   62 
 vcl/source/gdi/pdfwriter_impl.cxx|  296 ++--
 vcl/source/gdi/pdfwriter_impl2.cxx   |  348 ---
 vcl/source/pdf/EncryptionHashTransporter.cxx |   55 +++
 vcl/source/pdf/PDFEncryptor.cxx  |  393 +++
 8 files changed, 701 insertions(+), 606 deletions(-)

New commits:
commit 2143961a14c39be485f3a99dfe82b0c0a215b41e
Author: Tomaž Vajngerl 
AuthorDate: Mon Nov 4 16:45:25 2024 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 4 21:51:57 2024 +0100

pdf: move encryption methods into PDFEncryptor files

Moving more PDF encryption implementation into common encryption
files. This will make it easier to add new encryption later on as
the code will be in one place.

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

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index f42741fe6bf3..13d5a0076aca 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -501,6 +501,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/pdf/EncryptionHashTransporter \
 vcl/source/pdf/ExternalPDFStreams \
 vcl/source/pdf/PDFiumTools \
+vcl/source/pdf/PDFEncryptor \
 vcl/source/pdf/PdfConfig \
 vcl/source/pdf/ResourceDict \
 vcl/source/pdf/Matrix3 \
diff --git a/vcl/inc/pdf/EncryptionHashTransporter.hxx 
b/vcl/inc/pdf/EncryptionHashTransporter.hxx
index 0da0db3d8654..3ed1aa375561 100644
--- a/vcl/inc/pdf/EncryptionHashTransporter.hxx
+++ b/vcl/inc/pdf/EncryptionHashTransporter.hxx
@@ -24,7 +24,7 @@ namespace vcl::pdf
clear text passwords down till they can be used in PDFWriter. Unfortunately
the MD5 sum of the password (which is needed to create the PDF encryption 
key)
is not sufficient, since an MD5 digest cannot be created in an arbitrary 
state
-   which would be needed in PDFWriterImpl::computeEncryptionKey.
+   which would be needed in computeEncryptionKey.
 */
 class EncryptionHashTransporter : public 
cppu::WeakImplHelper
 {
diff --git a/vcl/inc/pdf/PDFEncryptor.hxx b/vcl/inc/pdf/PDFEncryptor.hxx
index c93fc0bec9e9..e1602f11723f 100644
--- a/vcl/inc/pdf/PDFEncryptor.hxx
+++ b/vcl/inc/pdf/PDFEncryptor.hxx
@@ -11,11 +11,50 @@
 #pragma once
 
 #include 
+#include 
+#include 
 
 namespace vcl::pdf
 {
+class EncryptionHashTransporter;
+
 constexpr sal_Int32 ENCRYPTED_PWD_SIZE = 32;
 
+// the maximum password length
+constexpr sal_Int32 MD5_DIGEST_SIZE = 16;
+
+// security 128 bit
+constexpr sal_Int32 SECUR_128BIT_KEY = 16;
+
+// maximum length of MD5 digest input, in step 2 of algorithm 3.1
+// PDF spec ver. 1.4: see there for details
+constexpr sal_Int32 MAXIMUM_RC4_KEY_LENGTH = SECUR_128BIT_KEY + 3 + 2;
+
+void padPassword(std::u16string_view i_rPassword, sal_uInt8* o_pPaddedPW);
+
+/* algorithm 3.2: compute an encryption key */
+bool computeEncryptionKey(vcl::pdf::EncryptionHashTransporter*,
+  vcl::PDFWriter::PDFEncryptionProperties& 
io_rProperties,
+  sal_Int32 i_nAccessPermissions);
+
+/* algorithm 3.3: computing the encryption dictionary'ss owner password value 
( /O ) */
+bool computeODictionaryValue(const sal_uInt8* i_pPaddedOwnerPassword,
+ const sal_uInt8* i_pPaddedUserPassword,
+ std::vector& io_rOValue, sal_Int32 
i_nKeyLength);
+
+/* algorithm 3.4 or 3.5: computing the encryption dictionary's user password 
value ( /U ) revision 2 or 3 of the standard security handler */
+bool computeUDictionaryValue(vcl::pdf::EncryptionHashTransporter* 
i_pTransporter,
+ vcl::PDFWriter::PDFEncryptionProperties& 
io_rProperties,
+ sal_Int32 i_nKeyLength, sal_Int32 
i_nAccessPermissions);
+
+void computeDocumentIdentifier(std::vector& o_rIdentifier,
+   const vcl::PDFWriter::PDFDocInfo& i_rDocInfo,
+   const OString& i_rCString1,
+   const css::util::DateTime& rCreationMetaDate, 
OString& o_rCString2);
+
+sal_Int32 computeAccessPermissions(const 
vcl::PDFWriter::PDFEncryptionProperties& i_rProperties,
+   sal_Int32& o_rKeyLength, sal_Int32& 
o_rRC4KeyLength);
+
 class PDFEncryptor
 {
 public:
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 68c49841baf6..92e5452e0c70 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -67,18 +67,9 @@ class FontSubsetInfo;
 class ZCodec;
 struct BitStreamState;
 namespace vcl::font { class PhysicalFontFace; }
-namespace vcl::pdf { class Enc

core.git: 2 commits - vcl/inc vcl/source

2024-11-04 Thread Tomaž Vajngerl (via logerrit)
 vcl/inc/pdf/pdfwriter_impl.hxx|5 +
 vcl/source/gdi/pdfwriter_impl.cxx |  147 +++---
 2 files changed, 111 insertions(+), 41 deletions(-)

New commits:
commit 152780e4340e12397a64320bc66185000871be35
Author: Tomaž Vajngerl 
AuthorDate: Thu Oct 31 23:59:00 2024 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 4 21:51:12 2024 +0100

pdf: add m_nPDFA_Version to simplify PDF/A versions

We have a bool for each PDFA version, which is inflexible when
checking if the feature is supported in a range of versions so
this adds a version number which simplifies checks a bit.

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

diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 24a2858ec994..41e137481e9e 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -1097,10 +1097,11 @@ i12626
 /* true if PDF/A-4 is output */
 bool m_bIsPDF_A4 = false;
 
+sal_Int32 m_nPDFA_Version = 0;
+
 /* PDF/UA support enabled */
 bool m_bIsPDF_UA = false;
 
-
 PDFWriter&  m_rOuterFace;
 
 /*
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index b5d7ad31cf08..fd9d3ee1ef30 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1394,18 +1394,22 @@ PDFWriterImpl::PDFWriterImpl( const 
PDFWriter::PDFWriterContext& rContext,
 switch (m_aContext.Version)
 {
 case PDFWriter::PDFVersion::PDF_A_1:
+m_nPDFA_Version = 1;
 m_bIsPDF_A1 = true;
 m_aContext.Version = PDFWriter::PDFVersion::PDF_1_4; //meaning we 
need PDF 1.4, PDF/A flavour
 break;
 case PDFWriter::PDFVersion::PDF_A_2:
+m_nPDFA_Version = 2;
 m_bIsPDF_A2 = true;
 m_aContext.Version = PDFWriter::PDFVersion::PDF_1_7;
 break;
 case PDFWriter::PDFVersion::PDF_A_3:
+m_nPDFA_Version = 3;
 m_bIsPDF_A3 = true;
 m_aContext.Version = PDFWriter::PDFVersion::PDF_1_7;
 break;
 case PDFWriter::PDFVersion::PDF_A_4:
+m_nPDFA_Version = 4;
 m_bIsPDF_A4 = true;
 m_aContext.Version = PDFWriter::PDFVersion::PDF_2_0;
 break;
@@ -3802,7 +3806,7 @@ bool PDFWriterImpl::emitLinkAnnotations()
 // i59651: key /F set bits Print to 1 rest to 0. We don't set NoZoom NoRotate 
to 1, since it's a 'should'
 // see PDF 8.4.2 and ISO 19005-1:2005 6.5.3
 aLine.append( "< 0)
 aLine.append( "/F 4" );
 aLine.append( "/Subtype/Link/Border[0 0 0]/Rect[" );
 
@@ -4148,7 +4152,7 @@ void PDFWriterImpl::emitTextAnnotationLine(OStringBuffer 
& aLine, PDFNoteEntry c
 
 // i59651: key /F set bits Print to 1 rest to 0. We don't set NoZoom 
NoRotate to 1, since it's a 'should'
 // see PDF 8.4.2 and ISO 19005-1:2005 6.5.3
-if (m_bIsPDF_A1 || m_bIsPDF_A2 || m_bIsPDF_A3 || m_bIsPDF_A4)
+if (m_nPDFA_Version > 0)
 aLine.append("/F 4 ");
 
 aLine.append("/Popup ");
@@ -4757,7 +4761,7 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, 
OStringBuffer& rAnnotDi
 
 // PDF/A requires sub-dicts for /FT/Btn objects (clause
 // 6.3.3)
-if( m_bIsPDF_A1 || m_bIsPDF_A2 || m_bIsPDF_A3 || m_bIsPDF_A4)
+if (m_nPDFA_Version > 0)
 {
 if( rWidget.m_eType == PDFWriter::RadioButton ||
 rWidget.m_eType == PDFWriter::CheckBox ||
@@ -5664,7 +5668,7 @@ bool PDFWriterImpl::emitCatalog()
 aLine.append( getResourceDictObj() );
 aLine.append( " 0 R" );
 // NeedAppearances must not be used if PDF is signed
-if(m_bIsPDF_A1 || m_bIsPDF_A2 || m_bIsPDF_A3 || m_bIsPDF_A4
+if (m_nPDFA_Version > 0
 #if HAVE_FEATURE_NSS
 || ( m_nSignatureObject != -1 )
 #endif
@@ -5981,7 +5985,7 @@ sal_Int32 PDFWriterImpl::emitNamedDestinations()
 // emits the output intent dictionary
 sal_Int32 PDFWriterImpl::emitOutputIntent()
 {
-if (!m_bIsPDF_A1 && !m_bIsPDF_A2 && !m_bIsPDF_A3 && !m_bIsPDF_A4)
+if (m_nPDFA_Version == 0) // not PDFA
 return 0;
 
 //emit the sRGB standard profile, in ICC format, in a stream, per 
IEC61966-2.1
@@ -6082,6 +6086,7 @@ static void lcl_assignMeta(const 
css::uno::Sequence& rValues, std::vec
 }
 
 // emits the document metadata
+// Since in PDF 1.4
 sal_Int32 PDFWriterImpl::emitDocumentMetadata()
 {
 if( !m_bIsPDF_A1 && !m_bIsPDF_A2 && !m_bIsPDF_A3 && !m_bIsPDF_A4 && 
!m_bIsPDF_UA)
@@ -6094,14 +6099,8 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
 {
 pdf::XmpMetadata aMetadata;
 
-if (m_bIsPDF_A1)
-aMetadata.mnPDF_A = 1;
-else if (m_bIsPDF_A2)
-aMetadata.mnPDF_A = 2;
-else if (m_bIsPDF_A3)

core.git: 2 commits - comphelper/CppunitTest_comphelper_test.mk comphelper/Library_comphelper.mk comphelper/qa comphelper/source include/comphelper include/oox oox/Library_oox.mk oox/qa oox/source sol

2024-11-04 Thread Tomaž Vajngerl (via logerrit)
 comphelper/CppunitTest_comphelper_test.mk |1 
 comphelper/Library_comphelper.mk  |1 
 comphelper/qa/unit/CryptoTest.cxx |  100 ++
 comphelper/source/crypto/Crypto.cxx   |  213 +-
 include/comphelper/crypto/Crypto.hxx  |   99 +
 include/oox/crypto/AgileEngine.hxx|   11 -
 include/oox/crypto/CryptTools.hxx |  121 -
 oox/Library_oox.mk|1 
 oox/qa/unit/CryptoTest.cxx|   60 
 oox/source/crypto/AgileEngine.cxx |   50 +++
 oox/source/crypto/Standard2007Engine.cxx  |   16 +-
 solenv/clang-format/excludelist   |2 
 vcl/source/gdi/pdfwriter_impl.cxx |   92 +++-
 13 files changed, 418 insertions(+), 349 deletions(-)

New commits:
commit c8cba8ae30baef6feca3b0613366d28df4a5e568
Author: Tomaž Vajngerl 
AuthorDate: Fri Nov 1 12:48:10 2024 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 4 21:51:32 2024 +0100

move CryptTools from oox to comphelper so we can reuse it

Also move the relevant tests and clean-up the names a bit to make
it mroe consistent.

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

diff --git a/comphelper/CppunitTest_comphelper_test.mk 
b/comphelper/CppunitTest_comphelper_test.mk
index 17de701aca26..3fe7c53f746e 100644
--- a/comphelper/CppunitTest_comphelper_test.mk
+++ b/comphelper/CppunitTest_comphelper_test.mk
@@ -20,6 +20,7 @@ $(eval $(call 
gb_CppunitTest_add_exception_objects,comphelper_test, \
 comphelper/qa/unit/types_test \
 comphelper/qa/unit/test_guards \
 comphelper/qa/unit/test_traceevent \
+comphelper/qa/unit/CryptoTest \
 ))
 
 $(eval $(call gb_CppunitTest_use_ure,comphelper_test))
diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk
index 2ab1b1bfa5d7..159aaa65248d 100644
--- a/comphelper/Library_comphelper.mk
+++ b/comphelper/Library_comphelper.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
 comphelper/source/container/enumerablemap \
 comphelper/source/container/enumhelper \
 comphelper/source/container/namecontainer \
+comphelper/source/crypto/Crypto \
 comphelper/source/eventattachermgr/eventattachermgr \
 comphelper/source/misc/accessiblecomponenthelper \
 comphelper/source/misc/accessibleeventnotifier \
diff --git a/comphelper/qa/unit/CryptoTest.cxx 
b/comphelper/qa/unit/CryptoTest.cxx
new file mode 100644
index ..2b0dac47416f
--- /dev/null
+++ b/comphelper/qa/unit/CryptoTest.cxx
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#if USE_TLS_NSS
+#include 
+#endif
+
+class CryptoTest : public CppUnit::TestFixture
+{
+public:
+virtual void tearDown()
+{
+#if USE_TLS_NSS
+NSS_Shutdown();
+#endif
+}
+
+void testCryptoHash();
+void testRoundUp();
+
+CPPUNIT_TEST_SUITE(CryptoTest);
+CPPUNIT_TEST(testCryptoHash);
+CPPUNIT_TEST(testRoundUp);
+CPPUNIT_TEST_SUITE_END();
+};
+
+void CryptoTest::testCryptoHash()
+{
+// Check examples from Wikipedia (https://en.wikipedia.org/wiki/HMAC)
+OString aContentString("The quick brown fox jumps over the lazy dog"_ostr);
+std::vector aContent(aContentString.getStr(),
+aContentString.getStr() + 
aContentString.getLength());
+std::vector aKey = { 'k', 'e', 'y' };
+{
+comphelper::CryptoHash aCryptoHash(aKey, 
comphelper::CryptoHashType::SHA1);
+aCryptoHash.update(aContent);
+std::vector aHash = aCryptoHash.finalize();
+
CPPUNIT_ASSERT_EQUAL(std::string("de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"),
+ comphelper::hashToString(aHash));
+}
+
+{
+comphelper::CryptoHash aCryptoHash(aKey, 
comphelper::CryptoHashType::SHA256);
+aCryptoHash.update(aContent);
+std::vector aHash = aCryptoHash.finalize();
+CPPUNIT_ASSERT_EQUAL(
+
std::string("f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8"),
+comphelper::hashToString(aHash));
+}
+
+{
+comphelper::CryptoHash aCryptoHash(aKey, 
comphelper::CryptoHashType::SHA384);
+aCryptoHash.update(aContent);
+std::vector aHash = aCryptoHash.finalize();
+
CPPUNIT_ASSERT_EQUAL(std::string("d7f4727e2c0b39ae0f1e40cc96f60242d5b7801841cea6fc592c5d3e1"
+

core.git: 2 commits - comphelper/qa comphelper/source filter/source include/comphelper

2024-11-04 Thread Tomaž Vajngerl (via logerrit)
 comphelper/qa/unit/test_hash.cxx |   26 +-
 comphelper/source/misc/hash.cxx  |   13 +++
 filter/source/pdf/impdialog.cxx  |   71 -
 filter/source/pdf/impdialog.hxx  |  158 +++
 include/comphelper/hash.hxx  |3 
 5 files changed, 104 insertions(+), 167 deletions(-)

New commits:
commit d9a0beb0b4dc22cf57ccb53ea0a4ab5442c43550
Author: Tomaž Vajngerl 
AuthorDate: Thu Oct 31 18:27:55 2024 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 4 21:20:01 2024 +0100

pdf: PDF dialog set the default member var. values in header file

Just a simplification and clean-up as this is easier to read.

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

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 3d86c3acabb4..fb9bab206a81 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -54,73 +54,10 @@ using namespace ::com::sun::star::uno;
  */
 ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< 
PropertyValue >& rFilterData,
 const Reference< XComponent >& rxDoc)
-: SfxTabDialogController(pParent, u"filter/ui/pdfoptionsdialog.ui"_ustr, 
u"PdfOptionsDialog"_ustr),
-mrDoc(rxDoc),
-maConfigItem( u"Office.Common/Filter/PDF/Export/", &rFilterData ),
-maConfigI18N( u"Office.Common/I18N/CTL/" ),
-mbIsPresentation( false ),
-mbIsSpreadsheet( false ),
-mbIsWriter( false ),
-
-mbSelectionPresent( false ),
-mbUseCTLFont( false ),
-mbUseLosslessCompression( true ),
-mnQuality( DefaultPDFJPEGQuality ),
-mbReduceImageResolution( false ),
-mnMaxImageResolution( DefaultPDFImageDPI ),
-mbUseTaggedPDF( false ),
-mbUseTaggedPDFUserSelection( false ),
-mbExportNotes( true ),
-mbExportNotesInMargin( false ),
-mbViewPDF( false ),
-mbUseReferenceXObject( false ),
-mbExportNotesPages( false ),
-mbExportOnlyNotesPages( false ),
-mbUseTransitionEffects( false ),
-mbIsSkipEmptyPages( true ),
-mbIsExportPlaceholders( false ),
-mbAddStream( false ),
-mnFormsType( 0 ),
-mbExportFormFields( false ),
-mbAllowDuplicateFieldNames( false ),
-mbExportBookmarks( true ),
-mbExportHiddenSlides ( false ),
-mbSinglePageSheets ( false ),
-mnOpenBookmarkLevels( -1 ),
-
-mbHideViewerToolbar( false ),
-mbHideViewerMenubar( false ),
-mbHideViewerWindowControls( false ),
-mbResizeWinToInit( false ),
-mbCenterWindow( false ),
-mbOpenInFullScreenMode( false ),
-mbDisplayPDFDocumentTitle( false ),
-mnMagnification( 0 ),
-mnInitialView( 1 ),
-mnZoom( 0 ),
-mnInitialPage( 1 ),
-mnPageLayout( 0 ),
-mbFirstPageLeft( false ),
-
-mbEncrypt( false ),
-mbRestrictPermissions( false ),
-mnPrint( 0 ),
-mnChangesAllowed( 0 ),
-mbCanCopyOrExtract( false ),
-mbCanExtractForAccessibility( true ),
-
-mbIsPageRangeChecked( false ),
-msPageRange( ' ' ),
-mbIsSheetRangeChecked( false ),
-msSheetRange( ' ' ),
-
-mbSelectionIsChecked( false ),
-mbExportRelativeFsysLinks( false ),
-mnViewPDFMode( 0 ),
-mbConvertOOoTargets( false ),
-mbExportBmkToPDFDestination( false ),
-
-mbSignPDF( false )
+: SfxTabDialogController(pParent, u"filter/ui/pdfoptionsdialog.ui"_ustr, 
u"PdfOptionsDialog"_ustr)
+, mrDoc(rxDoc)
+, maConfigItem( u"Office.Common/Filter/PDF/Export/", &rFilterData )
+, maConfigI18N( u"Office.Common/I18N/CTL/" )
 {
 // check for selection
 try
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 95d25f99d705..0db3c4e66ed5 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -60,94 +60,94 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 {
 css::uno::Reference mrDoc;
 
-FilterConfigItemmaConfigItem;
-FilterConfigItemmaConfigI18N;
+FilterConfigItem maConfigItem;
+FilterConfigItem maConfigI18N;
 
-Any maSelection;
+Any maSelection;
 
 DECL_LINK(CancelHdl, weld::Button&, void);
 DECL_LINK(OkHdl, weld::Button&, void);
 
 // the following data are the configuration used throughout the dialog and 
pages
-boolmbIsPresentation;
-boolmbIsSpreadsheet;
-boolmbIsWriter;
-boolmbSelectionPresent;
-boolmbUseCTLFont;
-boolmbUseLosslessCompression;
-sal_Int32   mnQuality;
-boolmbReduceImageResolution;
-sal_Int32   mnMaxImageResolution;
-boolmbUseTaggedPDF;
-boolmbUseTaggedPDFUserSelection;
-

core.git: 2 commits - filter/source include/vcl officecfg/registry oox/source vcl/inc vcl/source

2024-11-04 Thread Tomaž Vajngerl (via logerrit)
 filter/source/pdf/pdfexport.cxx|   17 +++
 include/vcl/pdfwriter.hxx  |   16 +++
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   15 +++
 oox/source/crypto/CryptTools.cxx   |   34 ---
 vcl/inc/pdf/pdfwriter_impl.hxx |   11 +-
 vcl/source/gdi/pdfwriter_impl.cxx  |   56 +++--
 6 files changed, 102 insertions(+), 47 deletions(-)

New commits:
commit cbc51154c02ec7a52a3ad047f3bab1670c9d481a
Author: Tomaž Vajngerl 
AuthorDate: Thu Oct 31 22:59:30 2024 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 4 21:20:25 2024 +0100

pdf: initial PDF 2.0 and PDF/A-4 support

Added PDF 2.0 and PDF/A-4 version to enums. Write the PDF 2.0
support for the file headers. Add the identical considitons as
for the PDF/A-4 as they were for PDF/A-3.

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

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 470a53cc38c5..8c42ebb7a5fa 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -754,21 +754,29 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_7;
 break;
 case 1:
-aContext.Version= vcl::PDFWriter::PDFVersion::PDF_A_1;
+aContext.Version = vcl::PDFWriter::PDFVersion::PDF_A_1;
 bUseTaggedPDF = true;   // force the tagged PDF as well
 mbRemoveTransparencies = true;  // does not allow 
transparencies
 bEncrypt = false;   // no encryption
 xEnc.clear();
 break;
 case 2:
-aContext.Version= vcl::PDFWriter::PDFVersion::PDF_A_2;
+aContext.Version = vcl::PDFWriter::PDFVersion::PDF_A_2;
 bUseTaggedPDF = true;   // force the tagged PDF as well
 mbRemoveTransparencies = false; // does allow transparencies
 bEncrypt = false;   // no encryption
 xEnc.clear();
 break;
 case 3:
-aContext.Version= vcl::PDFWriter::PDFVersion::PDF_A_3;
+aContext.Version = vcl::PDFWriter::PDFVersion::PDF_A_3;
+bUseTaggedPDF = true;   // force the tagged PDF as well
+mbRemoveTransparencies = false; // does allow transparencies
+bEncrypt = false;   // no encryption
+xEnc.clear();
+break;
+case 4:
+// TODO - determine what is allowed for PDFA/4
+aContext.Version = vcl::PDFWriter::PDFVersion::PDF_A_4;
 bUseTaggedPDF = true;   // force the tagged PDF as well
 mbRemoveTransparencies = false; // does allow transparencies
 bEncrypt = false;   // no encryption
@@ -783,6 +791,9 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 case 17:
 aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_7;
 break;
+case 20:
+aContext.Version = vcl::PDFWriter::PDFVersion::PDF_2_0;
+break;
 }
 
 // PDF/UA support
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 90d1a48754d1..2d6c517dc7ba 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -99,8 +99,20 @@ public:
 
 enum class Orientation { Portrait, Inherit };
 
-// in case the below enum is added PDF_2_0, please add just after PDF_1_7
-enum class PDFVersion { PDF_1_4, PDF_1_5, PDF_1_6, PDF_1_7, PDF_A_1, 
PDF_A_2, PDF_A_3 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
+
+enum class PDFVersion
+{
+PDF_1_4,
+PDF_1_5,
+PDF_1_6,
+PDF_1_7,
+PDF_2_0,
+PDF_A_1,
+PDF_A_2,
+PDF_A_3,
+PDF_A_4, // Based on PDF 2.0
+}; //i59651, PDF/A-1b & -1a, only -1b implemented for now
+
 // for the meaning of DestAreaType please look at PDF Reference Manual
 // version 1.4 section 8.2.1, page 475
 enum class DestAreaType { XYZ, FitRectangle };
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 74d4be9d1d2d..40eaaa6978c3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5058,6 +5058,11 @@
   PDF 1.7
 
   
+  
+
+

core.git: config_host/config_emscripten.h.in config_host.mk.in configure.ac solenv/gbuild vcl/qt5

2024-11-04 Thread Stephan Bergmann (via logerrit)
 config_host.mk.in  |1 +
 config_host/config_emscripten.h.in |2 ++
 configure.ac   |   16 
 solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |4 
 vcl/qt5/QtInstance.cxx |3 ++-
 5 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit f510ce620fba08e6aa8bc40af2e47f0b51caa66d
Author: Stephan Bergmann 
AuthorDate: Mon Nov 4 17:46:47 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Nov 4 20:47:05 2024 +0100

Add experimental support for Emscripten JSPI

...which I've seen fundamentally working when building with recent emsdk 
against
recent Qt6 trunk (and including  
"Update
the check for WebAssembly JSPI support") and running on recent Chrome (with 
JSPI
enabled under )

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

diff --git a/config_host.mk.in b/config_host.mk.in
index 20c027405df2..78874b1ee149 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -176,6 +176,7 @@ export ENABLE_DEBUG=@ENABLE_DEBUG@
 ENABLE_DOTNET=@ENABLE_DOTNET@
 SYSTEM_DRAGONBOX=@SYSTEM_DRAGONBOX@
 SYSTEM_FROZEN=@SYSTEM_FROZEN@
+export ENABLE_EMSCRIPTEN_JSPI=@ENABLE_EMSCRIPTEN_JSPI@
 export 
ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS=@ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS@
 export ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD=@ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD@
 export ENABLE_EPOXY=@ENABLE_EPOXY@
diff --git a/config_host/config_emscripten.h.in 
b/config_host/config_emscripten.h.in
index d8121613a934..c42a43c31e76 100644
--- a/config_host/config_emscripten.h.in
+++ b/config_host/config_emscripten.h.in
@@ -9,6 +9,8 @@
 
 #pragma once
 
+#define HAVE_EMSCRIPTEN_JSPI 0
+
 #define HAVE_EMSCRIPTEN_PROXY_POSIX_SOCKETS 0
 
 #define HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD 0
diff --git a/configure.ac b/configure.ac
index b1bdb7ef6030..01cb56658cff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2180,6 +2180,14 @@ AC_ARG_WITH(main-module,
 Default value is 'writer'.]),
 ,)
 
+if test "$_os" = Emscripten; then
+AC_ARG_ENABLE(emscripten-jspi,
+AS_HELP_STRING([--enable-emscripten-jspi],
+[Experimentally enable use of the Emscripten -sJSPI feature.]))
+else
+enable_emscripten_jspi=
+fi
+
 if test "$_os" = Emscripten; then
 AC_ARG_ENABLE(emscripten-proxy-to-pthread,
 AS_HELP_STRING([--disable-emscripten-proxy-to-pthread],
@@ -4199,6 +4207,14 @@ AC_SUBST(ENABLE_WASM_STRIP)
 AC_SUBST(ENABLE_WASM_STRIP_WRITER)
 AC_SUBST(ENABLE_WASM_STRIP_CALC)
 
+if test "$enable_emscripten_jspi" = yes; then
+ENABLE_EMSCRIPTEN_JSPI=TRUE
+AC_DEFINE(HAVE_EMSCRIPTEN_JSPI)
+else
+ENABLE_EMSCRIPTEN_JSPI=
+fi
+AC_SUBST(ENABLE_EMSCRIPTEN_JSPI)
+
 if test "$enable_emscripten_proxy_to_pthread" = yes; then
 ENABLE_EMSCRIPTEN_PROXY_TO_PTHREAD=TRUE
 AC_DEFINE(HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD)
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 4426deba0d02..4165281d1c09 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -30,6 +30,10 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072 
-sDEFAULT_PTHREAD_STACK_SIZE=65536
 gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s 
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s 
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
 $(ENABLE_QT6),$(COMMA)"FS"$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS 
-DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
+ifeq ($(ENABLE_EMSCRIPTEN_JSPI),TRUE)
+gb_EMSCRIPTEN_LDFLAGS += -sJSPI
+endif
+
 ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
 gb_EMSCRIPTEN_LDFLAGS += -sPROXY_POSIX_SOCKETS -lwebsocket.js
 endif
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index fe6fd90d0bea..b6b31366abfa 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -53,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -298,7 +299,7 @@ QtInstance::QtInstance(std::unique_ptr& pQApp)
 
 #ifndef EMSCRIPTEN
 m_bSupportsOpenGL = true;
-#else
+#elif !HAVE_EMSCRIPTEN_JSPI
 ImplGetSVData()->maAppData.m_bUseSystemLoop = true;
 #endif
 }


Re: Damage in macOS Silicon Mac installer for LibreOffice 24.2.7?

2024-11-04 Thread Patrick Luby
OK. I finally found a way to stop the crashing:

https://gerrit.libreoffice.org/c/core/+/176037

Apparently, doing a dynamic_cast from a UNO reference to its base pointer is 
failing in two places so use static_cast for now.

Patrick

core.git: cui/uiconfig

2024-11-04 Thread Olivier Hallot (via logerrit)
 cui/uiconfig/ui/optviewpage.ui |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 5de26fbf37f02a9c5a0ae96140ec50167709eaf2
Author: Olivier Hallot 
AuthorDate: Fri Nov 1 17:32:34 2024 -0300
Commit: Olivier Hallot 
CommitDate: Tue Nov 5 07:28:08 2024 +0100

tdf#137680 Add extended tips for Skia options

Change-Id: If525c808a1ad350c878cf8f80ee3289a0c6fcbb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175938
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index 6ad847830136..7bbce0bc6526 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -547,6 +547,11 @@
 Requires restart
 True
 True
+
+  
+Use the high 
performance Skia graphics engine to render all visual elements of the 
application, including windows, menus, toolbars and icons.
+  
+
   
   
 1
@@ -563,6 +568,11 @@
 18
 True
 True
+
+  
+Disables 
Skia's use of the computer graphics device. This still uses Skia software but 
with calls for raster framing, reduced and simplified graphics processing unit 
load.
+  
+
   
   
 1


core.git: svgio/source

2024-11-04 Thread Mike Kaganski (via logerrit)
 svgio/source/svgreader/SvgNumber.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 962bd03938e3e5cf513b91ed897ac11c248e827a
Author: Mike Kaganski 
AuthorDate: Mon Nov 4 21:31:39 2024 +0200
Commit: Mike Kaganski 
CommitDate: Tue Nov 5 06:36:16 2024 +0100

Simplify a bit

SVG diagonal percentage distances are defined in terms of
viewBox diagonal length divided by sqrt(2) (normalized).

See https://svgwg.org/svg2-draft/coords.html#Units

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

diff --git a/svgio/source/svgreader/SvgNumber.cxx 
b/svgio/source/svgreader/SvgNumber.cxx
index 72a44dbdd032..35293beee197 100644
--- a/svgio/source/svgreader/SvgNumber.cxx
+++ b/svgio/source/svgreader/SvgNumber.cxx
@@ -107,12 +107,8 @@ double SvgNumber::solve(const InfoProvider& rInfoProvider, 
NumberType aNumberTyp
 else // length
 {
 // it's a length, relative to sqrt((w^2 + h^2)/2)
-const double fCurrentWidth(aViewPort.getWidth());
-const double fCurrentHeight(aViewPort.getHeight());
-const double fCurrentLength(
-sqrt((fCurrentWidth * fCurrentWidth + fCurrentHeight * 
fCurrentHeight)/2.0));
-
-fRetval *= fCurrentLength;
+const double fDiagLength(std::hypot(aViewPort.getWidth(), 
aViewPort.getHeight()));
+fRetval *= fDiagLength / M_SQRT2;
 }
 }
 


core.git: 3 commits - vcl/qt5 vcl/README.vars.md

2024-11-04 Thread Michael Weghorn (via logerrit)
 vcl/README.vars.md|4 +++-
 vcl/qt5/QtInstance.cxx|5 -
 vcl/qt5/QtInstanceBuilder.cxx |1 +
 vcl/qt5/QtInstanceEntry.cxx   |   29 +++--
 4 files changed, 35 insertions(+), 4 deletions(-)

New commits:
commit 742b2d2416b7d80c3127cabd5c01db0e439204a5
Author: Michael Weghorn 
AuthorDate: Mon Nov 4 17:17:20 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 5 08:21:17 2024 +0100

tdf#130857 qt weld: Declare support for password dialog

Add .ui file for the password that can be triggered via
"File" -> "Properties" -> "Security" -> "Protect..." in Writer.

This means that native Qt widgets are used for that dialog
now when LO gets started with environment variable
SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.

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

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index 298f1f921333..a8ced91c1af2 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -55,6 +55,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile)
 u"modules/swriter/ui/renameobjectdialog.ui"_ustr,
 u"modules/swriter/ui/wordcount.ui"_ustr,
 u"sfx/ui/licensedialog.ui"_ustr,
+u"sfx/ui/password.ui"_ustr,
 u"sfx/ui/querysavedialog.ui"_ustr,
 u"sfx/ui/safemodequerydialog.ui"_ustr,
 u"svt/ui/printersetupdialog.ui"_ustr,
commit c5bf243cb3734b19cb952d1dd7d628c704fab98a
Author: Michael Weghorn 
AuthorDate: Mon Nov 4 16:49:42 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 5 08:21:09 2024 +0100

tdf#130857 qt weld: Implement QtInstanceEntry::set_message_type

For weld::EntryMessageType::Warning and
weld::EntryMessageType::Error, set a warning/error
icon from the icon theme at the end of the entry using
QLineEdit::addAction.

The GTK implementation (GtkInstanceEntry::set_message_type)
also does this. That one also sets a background color, which
the Qt implementation doesn't do for now.

This method is used e.g. by the "File" -> "Properties"
-> "Security" -> "Protect..." dialog in Writer, which
will be declared as supported in an upcoming commit.

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

diff --git a/vcl/qt5/QtInstanceEntry.cxx b/vcl/qt5/QtInstanceEntry.cxx
index f1001cc834db..46f9744138d4 100644
--- a/vcl/qt5/QtInstanceEntry.cxx
+++ b/vcl/qt5/QtInstanceEntry.cxx
@@ -12,6 +12,8 @@
 
 #include 
 
+#include 
+
 QtInstanceEntry::QtInstanceEntry(QLineEdit* pLineEdit)
 : QtInstanceWidget(pLineEdit)
 , m_pLineEdit(pLineEdit)
@@ -114,9 +116,32 @@ bool QtInstanceEntry::get_editable() const
 return bEditable;
 }
 
-void QtInstanceEntry::set_message_type(weld::EntryMessageType)
+void QtInstanceEntry::set_message_type(weld::EntryMessageType eType)
 {
-assert(false && "Not implemented yet");
+SolarMutexGuard g;
+
+GetQtInstance().RunInMainThread([&] {
+for (QAction* pAction : m_pLineEdit->actions())
+m_pLineEdit->removeAction(pAction);
+
+switch (eType)
+{
+case weld::EntryMessageType::Normal:
+// don't do anything special
+return;
+case weld::EntryMessageType::Warning:
+m_pLineEdit->addAction(QIcon::fromTheme("dialog-warning"),
+   QLineEdit::TrailingPosition);
+return;
+case weld::EntryMessageType::Error:
+m_pLineEdit->addAction(QIcon::fromTheme("dialog-error"),
+   QLineEdit::TrailingPosition);
+return;
+default:
+assert(false && "Unknown EntryMessageType");
+return;
+}
+});
 }
 
 void QtInstanceEntry::set_placeholder_text(const OUString& rText)
commit a2f5b750471c2fb29026b169bd1121e58a96927c
Author: Michael Weghorn 
AuthorDate: Mon Nov 4 15:17:31 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 5 08:21:03 2024 +0100

tdf#130857 qt weld: Make opt-in for now

Except for the simple message dialogs created in
QtInstance::CreateMessageDialog, disable the use
of native Qt dialogs by default for now, and only
use those if the user explicitly opts in to use
them by setting the SAL_VCL_QT_USE_WELDED_WIDGETS
environment variable.

While those dialogs declared as supported in
QtInstanceBuilder::IsUIFileSupported are meant to be
fully functional, they are only a small subset
of all LO dialogs and not all properties for
widgets are evaluated by QtBuilder at this point in
time (e.g. not all 

core.git: vcl/inc vcl/qt5

2024-11-04 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtBuilder.hxx |2 -
 vcl/qt5/QtBuilder.cxx |   66 +-
 2 files changed, 49 insertions(+), 19 deletions(-)

New commits:
commit bf42162fc50d0c6f8e567d8765f8b14b96d7cc50
Author: Michael Weghorn 
AuthorDate: Mon Nov 4 19:06:15 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Nov 5 08:21:22 2024 +0100

tdf#130857 qt weld: Add extra QWidget parents for layouts

For "GtkBox" and "GtkGrid" objects in .ui files,
don't just create the corresponding QLayout objects,
but create an extra QWidget object and set the
layout for that widget, i.e. use that QWidget as
the parent.

While this generally wouldn't be needed to properly
layout/handle things in Qt, having an associated
QWidget for the "GtkBox" and "GtkGrid" children
is needed in order to be able to create a
corresponding weld::Container (QtInstanceContainer)
for these, which derives from weld::Widget.
QLayout itself doesn't have the methods required to
implement weld::Widget, e.g. can't be hidden or shown.

Therefore, create a QWidget for these in addition,
except for special cases like the top-level layout
in a dialog or the dialog's button box.

For QGroupBox (created for "GtkFrame" objects),
this now means that the direct child is no more
necessarily a layout. Just setting a QWidget
as a child wouldn't suffice for proper layouting.
Therefore, explicitly create a layout for parent
widgets that don't have a layout set yet.

Adjust QtBuilder::applyPackingProperties
accordingly as well. Now, there's no more
use case to call QtBuilder::applyGridPackingProperties
with a QLayout for the current child. Get the
corresponding QWidget parent (if there is one)
before calling the method instead, and switch the
param from QObject* to QWidget* to simplify the
method.

Having an extra widget might have the side-effect
that extra spacing/margins might be used. If that
turns out to be a problem, these can presumably
explicitly be reduced (e.g. set to 0 for the relevant
objects) as needed later.

At least the 19 dialogs currently listed as supported in
QtInstanceBuilder::IsUIFileSupported still look OK to
me in a quick test with this commit in place.

Actually making use of the newly added widgets
to implement more of the QtInstanceContainer logic
will be done in separate commits.

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

diff --git a/vcl/inc/qt5/QtBuilder.hxx b/vcl/inc/qt5/QtBuilder.hxx
index ccc199ec4c16..f3945cdc5dff 100644
--- a/vcl/inc/qt5/QtBuilder.hxx
+++ b/vcl/inc/qt5/QtBuilder.hxx
@@ -75,7 +75,7 @@ private:
 static QWidget* windowForObject(QObject* pObject);
 static QDialogButtonBox* findButtonBox(QDialog* pDialog);
 
-static void applyGridPackingProperties(QObject* pCurrentChild, 
QGridLayout& rGrid,
+static void applyGridPackingProperties(QWidget* pCurrentChild, 
QGridLayout& rGrid,
const stringmap& 
rPackingProperties);
 };
 
diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index 330774715bbb..91cd1839d055 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -105,6 +105,9 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, cons
 QLayout* pParentLayout = qobject_cast(pParent);
 
 QObject* pObject = nullptr;
+// in case a QLayout is created, an additional QWidget parent
+// will also be created because that is needed for QtInstanceContainer
+QWidget* pLayoutParentWidget = nullptr;
 
 if (sName == u"GtkMessageDialog")
 {
@@ -120,11 +123,20 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, cons
 }
 else
 {
+QWidget* pBoxParentWidget = pParentWidget;
+// Unless this is the direct GtkBox child of a GtkDialog, create a 
parent widget
+// that can be used to create a QtInstanceContainer for this box
+if (!qobject_cast(pParentWidget))
+{
+pLayoutParentWidget = new QWidget(pParentWidget);
+pBoxParentWidget = pLayoutParentWidget;
+}
+
 const bool bVertical = hasOrientationVertical(rMap);
 if (bVertical)
-pObject = new QVBoxLayout(pParentWidget);
+pObject = new QVBoxLayout(pBoxParentWidget);
 else
-pObject = new QHBoxLayout(pParentWidget);
+pObject = new QHBoxLayout(pBoxParentWidget);
 }
 }
 else if (sName == u"GtkButtonBox")
@@ -189,7 +201,8 @@ QObject* QtBuilder::makeObject(QObject* pParent, 
std::u16string_view sName, cons
 }
 else if (sName == u"GtkGrid"

core.git: basegfx/source

2024-11-04 Thread Mike Kaganski (via logerrit)
 basegfx/source/polygon/b2dsvgpolypolygon.cxx |   15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 35b3abf5831fe05360f58dd7d292602785a55281
Author: Mike Kaganski 
AuthorDate: Mon Nov 4 21:06:15 2024 +0200
Commit: Mike Kaganski 
CommitDate: Tue Nov 5 05:35:12 2024 +0100

Simplify a bit

The expression can't be negative. It's a Pythagorean sum.

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

diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx 
b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 7e525d5e1644..a7a25e6e17bb 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -543,20 +543,7 @@ namespace basegfx::utils
 // of radicant solved for fRY,
 // with s=fRX/fRY)
 const double fRatio(fRX/fRY);
-const double fRadicant2(
-p1_prime.getY()*p1_prime.getY() +
-
p1_prime.getX()*p1_prime.getX()/(fRatio*fRatio));
-if( fRadicant2 < 0.0 )
-{
-// only trivial solution, one
-// of the axes 0 -> straight
-// line segment according to
-// SVG spec
-aCurrPoly.append(B2DPoint(nX, nY));
-continue;
-}
-
-fRY=sqrt(fRadicant2);
+fRY=std::hypot(p1_prime.getY(), 
p1_prime.getX()/fRatio);
 fRX=fRatio*fRY;
 
 // keep center_prime forced to (0,0)


core.git: basctl/source

2024-11-04 Thread Mike Kaganski (via logerrit)
 basctl/source/basicide/unomodel.cxx |   36 +---
 basctl/source/basicide/unomodel.hxx |   11 +--
 2 files changed, 2 insertions(+), 45 deletions(-)

New commits:
commit 491d6ef7f297206b99ce01d4f2d00c75719ef243
Author: Mike Kaganski 
AuthorDate: Mon Nov 4 13:31:45 2024 +0500
Commit: Mike Kaganski 
CommitDate: Mon Nov 4 10:50:50 2024 +0100

Simplify a bit

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

diff --git a/basctl/source/basicide/unomodel.cxx 
b/basctl/source/basicide/unomodel.cxx
index c626134a96c4..595798fc49b8 100644
--- a/basctl/source/basicide/unomodel.cxx
+++ b/basctl/source/basicide/unomodel.cxx
@@ -68,13 +68,10 @@ public:
 namespace basctl
 {
 
-using namespace ::cppu;
 using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
 
 SIDEModel::SIDEModel( SfxObjectShell *pObjSh )
-: SfxBaseModel(pObjSh)
+: cppu::ImplInheritanceHelper(pObjSh)
 {
 }
 
@@ -82,37 +79,6 @@ SIDEModel::~SIDEModel()
 {
 }
 
-uno::Any SAL_CALL SIDEModel::queryInterface( const uno::Type& rType )
-{
-uno::Any aRet =  ::cppu::queryInterface ( rType,
-// OWeakObject interfaces
-static_cast< XInterface* >( static_cast< 
OWeakObject* >( this ) ),
-static_cast< XWeak* > ( this ),
-static_cast< XServiceInfo*  > ( this ) );
-if (!aRet.hasValue())
-aRet = SfxBaseModel::queryInterface ( rType );
-return aRet;
-}
-
-void SAL_CALL SIDEModel::acquire() noexcept
-{
-SolarMutexGuard aGuard;
-OWeakObject::acquire();
-}
-
-void SAL_CALL SIDEModel::release() noexcept
-{
-SolarMutexGuard aGuard;
-OWeakObject::release();
-}
-
-uno::Sequence< uno::Type > SAL_CALL SIDEModel::getTypes(  )
-{
-return comphelper::concatSequences(
-SfxBaseModel::getTypes(),
-uno::Sequence {  cppu::UnoType::get() });
-}
-
 OUString SIDEModel::getImplementationName()
 {
 return u"com.sun.star.comp.basic.BasicIDE"_ustr;
diff --git a/basctl/source/basicide/unomodel.hxx 
b/basctl/source/basicide/unomodel.hxx
index 9b0289032660..12414fc57f7f 100644
--- a/basctl/source/basicide/unomodel.hxx
+++ b/basctl/source/basicide/unomodel.hxx
@@ -24,8 +24,7 @@
 namespace basctl
 {
 
-class SIDEModel : public SfxBaseModel,
-public com::sun::star::lang::XServiceInfo
+class SIDEModel : public cppu::ImplInheritanceHelper
 {
 /// @throws css::io::IOException
 static void notImplemented();
@@ -33,14 +32,6 @@ public:
 explicit SIDEModel(SfxObjectShell *pObjSh);
 virtual ~SIDEModel() override;
 
-//XInterface
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
-virtual void SAL_CALL acquire(  ) noexcept override;
-virtual void SAL_CALL release(  ) noexcept override;
-
-//XTypeProvider
-virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
-
 //XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;


Rahim Siddiq License Statement

2024-11-04 Thread Rahim Siddiq
Dear Document Foundation Team,
I am writing to formally declare the licensing terms for all my contributions 
to the LibreOffice project.
I confirm that all of my past and future contributions to LibreOffice may be 
licensed under the MPLv2/LGPLv3+ dual license. This applies to all code, 
documentation, and any other contributions I have made or will make to the 
project.
Regards,
Rahim Siddiq


core.git: android/source

2024-11-04 Thread Weblate (via logerrit)
 android/source/res/values-ia/strings.xml |2 +-
 android/source/res/values-iw/strings.xml |6 +++---
 android/source/res/values-tl/strings.xml |2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 449df239a2a33d6789c12c1011c031b055cf0950
Author: Weblate 
AuthorDate: Mon Nov 4 08:02:56 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Nov 4 13:51:47 2024 +0100

android-viewer translated using Weblate

Hebrew currently translated at 100.0% (116 of 116 strings)

Change-Id: I5a39070be19791e0f85ee32487bcca8a1876a9b8

android-viewer translated using Weblate

Interlingua currently translated at 75.8% (88 of 116 strings)

Change-Id: Iea0eb23bf7d58d78fd99668a8b057f3d9295a3fc

Added translation for android-viewer using Weblate (Tagalog)

Change-Id: I2f97dbf569d5eda71dfdd2a62c5563bd7918d43b
Co-authored-by: Andy Flagg 
Co-authored-by: Weblate 
Co-authored-by: Yaron Shahrabani 
Co-authored-by: famese 
Translate-URL: 
https://translations.documentfoundation.org/projects/android-viewer/android-strings/he/
Translate-URL: 
https://translations.documentfoundation.org/projects/android-viewer/android-strings/ia/
Translation: android-viewer/android-strings
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175682
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/res/values-ia/strings.xml 
b/android/source/res/values-ia/strings.xml
index 8ee1aa2a1178..5b3952a19518 100644
--- a/android/source/res/values-ia/strings.xml
+++ b/android/source/res/values-ia/strings.xml
@@ -69,7 +69,7 @@
 Cancellar
 Trovar le sequente
 Trovar le previe
-Activar le modo de 
modification experimental. Usa lo sub tu proprie risco.
+Activar le modo de 
edition experimental. Usa lo sub tu proprie risco.
 Iste file es solo lectura
 Monstrar le aviso
 Cancellar
diff --git a/android/source/res/values-iw/strings.xml 
b/android/source/res/values-iw/strings.xml
index 2c50465ecd40..3a39a24e6e80 100644
--- a/android/source/res/values-iw/strings.xml
+++ b/android/source/res/values-iw/strings.xml
@@ -59,9 +59,9 @@
 הוספה
 מחיקה
 אורך מיטבי
-כיוון אורך
-כיוון גובה
-כיוון רוחב
+התאמת האורך
+התאמת הגובה
+התאמת הרוחב
 גובה מיטבי
 רוחב מיטבי
 אישור
diff --git a/android/source/res/values-tl/strings.xml 
b/android/source/res/values-tl/strings.xml
new file mode 100644
index ..a6b3daec9354
--- /dev/null
+++ b/android/source/res/values-tl/strings.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file


Re: Damage in macOS Silicon Mac installer for LibreOffice 24.2.7?

2024-11-04 Thread Patrick Luby
Thanks for the suggestion. It didn’t fix the problem but after my last post I 
did find the cause of the problem: it’s a complier optimization bug.

In my local release build, the problem stopped when I did a clean build and 
added the following in my autogen.input:

  --enable-optimized=no

Commenting that line out and doing a clean rebuild causes the problem to 
reappear so it’s definitely a bug in Xcode’s variant of clang.

Today I’ll try to find the right place in the code to turn off optimization 
like I did with a similar compiler optimization bug:

  https://gerrit.libreoffice.org/c/core/+/145742

Patrick


> On Nov 4, 2024, at 5:31 AM, Caolán McNamara  
> wrote:
> 
> No idea what is happening there, but I see that m_xPopupMenu in
> include/svtools/popupmenucontrollerbase.hxx is a VCLXPopupMenu and it
> seems to only need to be a VCLXMenu in case it makes any difference to
> use
> m_xPopupMenu = dynamic_cast(xPopupMenu.get());
> instead of
> m_xPopupMenu = dynamic_cast(xPopupMenu.get());
> in PopupMenuControllerBase::setPopupMenu



core.git: Branch 'distro/collabora/co-24.04' - sc/source

2024-11-04 Thread Noel Grandin (via logerrit)
 sc/source/core/data/column3.cxx |   35 +--
 1 file changed, 17 insertions(+), 18 deletions(-)

New commits:
commit 2ebb1205485cdc0bdd868ee0abe83e6a288b50da
Author: Noel Grandin 
AuthorDate: Mon Nov 4 14:24:26 2024 +0200
Commit: Caolán McNamara 
CommitDate: Mon Nov 4 14:31:16 2024 +0100

tdf#163667 speed up spreadsheet with lots of cond formatting (II)

Attempt to avoid the cost of GetCondResult when dealing with large runs
of identical cells

This restructures my caching code to increase the chance of hitting the
cache.

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

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 1021846f3075..15c70f0bade3 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2725,8 +2725,10 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, 
SCROW nRow2, ScFilterEntri
 
 ScAddress aCell(GetCol(), 0, GetTab());
 ScDocument& rDoc = GetDoc();
+// cache the output of GetCondResult
 const ScPatternAttr* pPrevPattern = nullptr;
 ScRefCellValue aPrevCellValue;
+Color aPrevPatternColor;
 while (nRow1 <= nRow2)
 {
 aCell.SetRow(nRow1);
@@ -2738,27 +2740,26 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, 
SCROW nRow2, ScFilterEntri
 
 if (pPattern)
 {
-// Speed up processing when dealing with runs of identical cells. 
We only
-// care about collecting unique colors, so no need to process a 
cell if the result
-// will be the same as the previous cell.
-// Which we can only do if there is no conditional format to 
override the color on this cell.
-if (!pCondFormat)
+if 
(!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty())
 {
+// Speed up processing when dealing with runs of identical 
cells. This avoids
+// an expensive GetCondResult call.
 ScRefCellValue aCellValue = GetCellValue(nRow1);
 if (pPrevPattern == pPattern && aCellValue == aPrevCellValue)
 {
-nRow1++;
-continue;
+aBackColor = aPrevPatternColor;
+bCondBackColor = true;
+}
+else
+{
+const SfxItemSet* pCondSet = rDoc.GetCondResult(GetCol(), 
nRow1, GetTab());
+const SvxBrushItem* pBrush = 
&pPattern->GetItem(ATTR_BACKGROUND, pCondSet);
+aBackColor = pBrush->GetColor();
+bCondBackColor = true;
+aPrevCellValue = aCellValue;
+pPrevPattern = pPattern;
+aPrevPatternColor = aBackColor;
 }
-aPrevCellValue = aCellValue;
-pPrevPattern = pPattern;
-}
-if 
(!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty())
-{
-const SfxItemSet* pCondSet = rDoc.GetCondResult(GetCol(), 
nRow1, GetTab());
-const SvxBrushItem* pBrush = 
&pPattern->GetItem(ATTR_BACKGROUND, pCondSet);
-aBackColor = pBrush->GetColor();
-bCondBackColor = true;
 }
 }
 
@@ -2775,8 +2776,6 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, 
SCROW nRow2, ScFilterEntri
 {
 aBackColor = *oColor;
 bCondBackColor = true;
-// we are overriding the color, so we need to clear 
the one-item cache.
-pPrevPattern = nullptr;
 }
 }
 }


core.git: include/svx svx/source

2024-11-04 Thread Miklos Vajna (via logerrit)
 include/svx/cube3d.hxx |   12 ++--
 svx/source/engine3d/cube3d.cxx |   28 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit c8606fc09b81d2666095d4cb4d8a813ef0ba1cc2
Author: Miklos Vajna 
AuthorDate: Mon Nov 4 08:18:14 2024 +0100
Commit: Miklos Vajna 
CommitDate: Mon Nov 4 14:31:42 2024 +0100

svx: prefix members of E3dCubeObj

See tdf#94879 for motivation.

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

diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx
index 7fff9931f642..30995a070f3c 100644
--- a/include/svx/cube3d.hxx
+++ b/include/svx/cube3d.hxx
@@ -47,11 +47,11 @@ class E3dDefaultAttributes;
 class SAL_WARN_UNUSED E3dCubeObj final : public E3dCompoundObject
 {
 // Parameter
-basegfx::B3DPoint   aCubePos;
-basegfx::B3DVector  aCubeSize;
+basegfx::B3DPoint   m_aCubePos;
+basegfx::B3DVector  m_aCubeSize;
 
 // BOOLeans
-boolbPosIsCenter : 1;
+boolm_bPosIsCenter : 1;
 
 void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
 virtual std::unique_ptr 
CreateObjectSpecificViewContact() override;
@@ -75,13 +75,13 @@ public:
 
 // Set local parameters with geometry recreation
 void SetCubePos(const basegfx::B3DPoint& rNew);
-const basegfx::B3DPoint& GetCubePos() const { return aCubePos; }
+const basegfx::B3DPoint& GetCubePos() const { return m_aCubePos; }
 
 void SetCubeSize(const basegfx::B3DVector& rNew);
-const basegfx::B3DVector& GetCubeSize() const { return aCubeSize; }
+const basegfx::B3DVector& GetCubeSize() const { return m_aCubeSize; }
 
 void SetPosIsCenter(bool bNew);
-bool GetPosIsCenter() const { return bPosIsCenter; }
+bool GetPosIsCenter() const { return m_bPosIsCenter; }
 
 // TakeObjName...() is for the display in the UI, for example "3 frames 
selected".
 virtual OUString TakeObjNameSingul() const override;
diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx
index 94e482659b97..42a215dd3477 100644
--- a/svx/source/engine3d/cube3d.cxx
+++ b/svx/source/engine3d/cube3d.cxx
@@ -46,8 +46,8 @@ E3dCubeObj::E3dCubeObj(
 SetDefaultAttributes(rDefault);
 
 // position centre or left, bottom, back (dependent on bPosIsCenter)
-aCubePos = aPos;
-aCubeSize = r3DSize;
+m_aCubePos = aPos;
+m_aCubeSize = r3DSize;
 }
 
 E3dCubeObj::E3dCubeObj(SdrModel& rSdrModel)
@@ -67,9 +67,9 @@ E3dCubeObj::E3dCubeObj(SdrModel& rSdrModel, E3dCubeObj const 
& rSource)
 
 SetDefaultAttributes(aDefault);
 
-aCubePos = rSource.aCubePos;
-aCubeSize = rSource.aCubeSize;
-bPosIsCenter = rSource.bPosIsCenter;
+m_aCubePos = rSource.m_aCubePos;
+m_aCubeSize = rSource.m_aCubeSize;
+m_bPosIsCenter = rSource.m_bPosIsCenter;
 }
 
 E3dCubeObj::~E3dCubeObj()
@@ -78,9 +78,9 @@ E3dCubeObj::~E3dCubeObj()
 
 void E3dCubeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
 {
-aCubePos = rDefault.GetDefaultCubePos();
-aCubeSize = rDefault.GetDefaultCubeSize();
-bPosIsCenter = rDefault.GetDefaultCubePosIsCenter();
+m_aCubePos = rDefault.GetDefaultCubePos();
+m_aCubeSize = rDefault.GetDefaultCubeSize();
+m_bPosIsCenter = rDefault.GetDefaultCubePosIsCenter();
 }
 
 SdrObjKind E3dCubeObj::GetObjIdentifier() const
@@ -104,27 +104,27 @@ rtl::Reference 
E3dCubeObj::CloneSdrObject(SdrModel& rTargetModel) con
 
 void E3dCubeObj::SetCubePos(const basegfx::B3DPoint& rNew)
 {
-if(aCubePos != rNew)
+if(m_aCubePos != rNew)
 {
-aCubePos = rNew;
+m_aCubePos = rNew;
 ActionChanged();
 }
 }
 
 void E3dCubeObj::SetCubeSize(const basegfx::B3DVector& rNew)
 {
-if(aCubeSize != rNew)
+if(m_aCubeSize != rNew)
 {
-aCubeSize = rNew;
+m_aCubeSize = rNew;
 ActionChanged();
 }
 }
 
 void E3dCubeObj::SetPosIsCenter(bool bNew)
 {
-if(bPosIsCenter != bNew)
+if(m_bPosIsCenter != bNew)
 {
-bPosIsCenter = bNew;
+m_bPosIsCenter = bNew;
 ActionChanged();
 }
 }


core.git: Branch 'libreoffice-24-8-3' - sw/source

2024-11-04 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/objectformattertxtfrm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a6d49c49bb25b85880099544488481ee74a1addc
Author: Caolán McNamara 
AuthorDate: Sun Oct 27 19:38:37 2024 +
Commit: Michael Stahl 
CommitDate: Mon Nov 4 14:39:32 2024 +0100

crashtesting: crash on loading ooo71160-2.doc

since:

commit 2d6addb180ad30383f4aaec198c22ccbf936fa87
CommitDate: Mon Oct 21 15:16:57 2024 +0200

tdf#163486 sw: PVS: identical sub-expressions

Change-Id: I601a72a8a39f3591d1110f65a027e89923befaca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175702
Tested-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 268a82d43425534761ef243d9204bfe4f4d3abc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175751
Reviewed-by: Thorsten Behrens 
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index 1fdad26a10ec..27793ce7855d 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -575,6 +575,8 @@ SwAnchoredObject* 
SwObjectFormatterTextFrame::GetFirstObjWithMovedFwdAnchor(
 static SwRowFrame const* FindTopLevelRowFrame(SwFrame const*const pFrame)
 {
 SwRowFrame * pRow = const_cast(pFrame)->FindRowFrame();
+if (!pRow)
+return nullptr;
 // looks like SwTabFrame has mbInfTab = true so go up 2 levels
 while (pRow->GetUpper()->GetUpper()->IsInTab())
 {


core.git: Branch 'distro/collabora/co-24.04' - writerfilter/source

2024-11-04 Thread Justin Luth (via logerrit)
 writerfilter/source/dmapper/PropertyMap.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 00515706481dddb46ec8f7b2f7a0e0f7e30a2f5c
Author: Justin Luth 
AuthorDate: Sat Nov 2 19:22:13 2024 -0400
Commit: Miklos Vajna 
CommitDate: Mon Nov 4 11:46:00 2024 +0100

tdf#161349 writerfilter: only copy page background vml fill

This fixes my 24.8 regression.

I had this clause in earlier versions of the patchset,
but it moved along with most of the other logic
to the initialization of the default page style.

However, I certainly need to limit copying the properties
of the default page style to ONLY the fill properties here as well.

Change-Id: I168f13ebeea3720eba53703210314f069fb87ae2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175963
Reviewed-by: Justin Luth 
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175964
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 7bdc4a688217..393142483710 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1215,6 +1215,8 @@ void 
SectionPropertyMap::HandleMarginsHeaderFooter(DomainMapper_Impl& rDM_Impl)
 rDM_Impl.GetPageStyles()->getByName("Standard"), 
uno::UNO_QUERY_THROW);
 for (const beans::Property& rProp : 
m_aPageStyle->getPropertySetInfo()->getProperties())
 {
+if (!rProp.Name.startsWith("Fill")) // only copy XATTR_FILL 
properties
+continue;
 try
 {
 const uno::Any aFillValue = 
xDefaultPageStyle->getPropertyValue(rProp.Name);


GSoC 2024 Final Work Product

2024-11-04 Thread Biswadeep Purkayastha
Hello everyone,

Following is the link to my final work product for my GSoC 2024 project on 
Integrating CPDB into the LibreOffice print dialog
https://medium.com/@bpdps95/providing-cpdb-support-for-the-libreoffice-print-dialog-my-gsoc-journey-e46f72d5a61c

Regards,
Biswadeep




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

2024-11-04 Thread Xisco Fauli (via logerrit)
 sd/source/ui/func/futext.cxx |   23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 9fc54b966b2b9d423cf594cd385224b0698f
Author: Xisco Fauli 
AuthorDate: Fri Oct 18 01:41:18 2024 +0200
Commit: Michael Stahl 
CommitDate: Mon Nov 4 14:50:20 2024 +0100

tdf#163486: PVS: check mpViewSh

V595The 'mpView' pointer was utilized before it was verified against 
nullptr. Check lines: 719, 720.

Change-Id: Ie1bda82df979fd5f293fb6eb9623917371e9da34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175113
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit 2e28f5a9f662f3995db06743ed043cbd094b1a68)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175489
Reviewed-by: Michael Stahl 

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index d90aefc7f542..8693a535c731 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -716,18 +716,21 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
 ForcePointer(&rMEvt);
 mpWindow->ReleaseMouse();
 
-const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-if ( mpView && rMarkList.GetMarkCount() == 0 )
+if (mpView)
 {
-sal_uInt16 nDrgLog1 = sal_uInt16 ( 
mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
-if ( std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 &&
- std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 &&
- !rMEvt.IsShift() && !rMEvt.IsMod2() )
+const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+if ( rMarkList.GetMarkCount() == 0 )
 {
-SdrPageView* pPV2 = mpView->GetSdrPageView();
-SdrViewEvent aVEvt;
-mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
-mpView->MarkObj(aVEvt.mpRootObj, pPV2);
+sal_uInt16 nDrgLog1 = sal_uInt16 ( 
mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
+if ( std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 &&
+ std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 &&
+ !rMEvt.IsShift() && !rMEvt.IsMod2() )
+{
+SdrPageView* pPV2 = mpView->GetSdrPageView();
+SdrViewEvent aVEvt;
+mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, 
aVEvt);
+mpView->MarkObj(aVEvt.mpRootObj, pPV2);
+}
 }
 }
 


core.git: helpcontent2

2024-11-04 Thread Olivier Hallot (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a3c66a31334f70ee0af2ed991c6cffb495b98e91
Author: Olivier Hallot 
AuthorDate: Mon Nov 4 15:44:21 2024 +0200
Commit: Gerrit Code Review 
CommitDate: Mon Nov 4 14:44:21 2024 +0100

Update git submodules

* Update helpcontent2 from branch 'master'
  to 76fd6af8937397407aca836ce2ffcf8d08219e07
  - Typos

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

diff --git a/helpcontent2 b/helpcontent2
index 02fd40af9c8a..76fd6af89373 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 02fd40af9c8a62babb4d8549be8af8dcd39f7635
+Subproject commit 76fd6af8937397407aca836ce2ffcf8d08219e07


core.git: Branch 'libreoffice-24-8' - include/vcl vcl/source

2024-11-04 Thread Xisco Fauli (via logerrit)
 include/vcl/toolbox.hxx|2 +-
 vcl/source/window/toolbox2.cxx |   26 ++
 2 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit 1ebff884cb1261d48130ea80fffc5bc0025a63df
Author: Xisco Fauli 
AuthorDate: Fri Oct 18 11:10:52 2024 +0200
Commit: Michael Stahl 
CommitDate: Mon Nov 4 14:48:54 2024 +0100

tdf#163486: PVS: check GetMenu()

V595The 'GetMenu()' pointer was utilized before it was verified against 
nullptr. Check lines: 1582, 1612.

Change-Id: I085320d3a5467e4e2c158bf2683b3156cb103e8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175125
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins
(cherry picked from commit ed4c5e3beb251e0ee13ad982ee7c512196c9923b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175142
Reviewed-by: Michael Stahl 

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index b4b7922ac6a1..779c5853f0b7 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -474,7 +474,7 @@ public:
 ToolBoxMenuType GetMenuType() const;
 SAL_DLLPRIVATE bool IsMenuEnabled() const;
 PopupMenu*  GetMenu() const;
-SAL_DLLPRIVATE void UpdateCustomMenu();
+SAL_DLLPRIVATE void UpdateCustomMenu(PopupMenu* pMenu);
 voidSetMenuExecuteHdl( const Link& rLink 
);
 
 // open custommenu
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 8460dcf680c1..c0c806038060 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1482,7 +1482,7 @@ bool ToolBox::IsMenuEnabled() const
 
 PopupMenu* ToolBox::GetMenu() const
 {
-return mpData == nullptr ? nullptr : mpData->mpMenu;
+return mpData ? mpData->mpMenu : nullptr;
 }
 
 void ToolBox::SetMenuExecuteHdl( const Link& rLink )
@@ -1512,10 +1512,9 @@ namespace
 }
 }
 
-void ToolBox::UpdateCustomMenu()
+void ToolBox::UpdateCustomMenu(PopupMenu* pMenu)
 {
 // fill clipped items into menu
-PopupMenu *pMenu = GetMenu();
 pMenu->Clear();
 
 // add menu items: first the overflow items, then hidden items, both in the
@@ -1560,9 +1559,10 @@ void ToolBox::UpdateCustomMenu()
 
 IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent&, rEvent, void )
 {
-if( rEvent.GetMenu() == GetMenu() && rEvent.GetId() == 
VclEventId::MenuSelect )
+PopupMenu *pMenu = GetMenu();
+if( pMenu && rEvent.GetMenu() == pMenu && rEvent.GetId() == 
VclEventId::MenuSelect )
 {
-sal_uInt16 id = GetMenu()->GetItemId( rEvent.GetItemPos() );
+sal_uInt16 id = pMenu->GetItemId( rEvent.GetItemPos() );
 if( id >= TOOLBOX_MENUITEM_START )
 TriggerItem( ToolBoxItemId(id - TOOLBOX_MENUITEM_START) );
 }
@@ -1573,17 +1573,20 @@ void ToolBox::ExecuteCustomMenu( const 
tools::Rectangle& rRect )
 if ( !IsMenuEnabled() || ImplIsInPopupMode() )
 return;
 
-UpdateCustomMenu();
+PopupMenu *pMenu = GetMenu();
+if (!pMenu)
+return;
+UpdateCustomMenu(pMenu);
 
 if( GetMenuType() & ToolBoxMenuType::Customize )
 // call button handler to allow for menu customization
 mpData->maMenuButtonHdl.Call( this );
 
-GetMenu()->AddEventListener( LINK( this, ToolBox, ImplCustomMenuListener ) 
);
+pMenu->AddEventListener( LINK( this, ToolBox, ImplCustomMenuListener ) );
 
 // make sure all disabled entries will be shown
-GetMenu()->SetMenuFlags(
-GetMenu()->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
+pMenu->SetMenuFlags(
+pMenu->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
 
 // toolbox might be destroyed during execute
 bool bBorderDel = false;
@@ -1603,14 +1606,13 @@ void ToolBox::ExecuteCustomMenu( const 
tools::Rectangle& rRect )
 }
 }
 
-sal_uInt16 uId = GetMenu()->Execute( pWin, tools::Rectangle( 
ImplGetPopupPosition( aMenuRect ), Size() ),
+sal_uInt16 uId = pMenu->Execute( pWin, tools::Rectangle( 
ImplGetPopupPosition( aMenuRect ), Size() ),
 PopupMenuFlags::ExecuteDown | 
PopupMenuFlags::NoMouseUpClose );
 
 if ( pWin->isDisposed() )
 return;
 
-if( GetMenu() )
-GetMenu()->RemoveEventListener( LINK( this, ToolBox, 
ImplCustomMenuListener ) );
+pMenu->RemoveEventListener( LINK( this, ToolBox, ImplCustomMenuListener ) 
);
 if( bBorderDel )
 {
 if( pBorderWin->isDisposed() )


help.git: source/text

2024-11-04 Thread Olivier Hallot (via logerrit)
 source/text/scalc/01/04060107.xhp |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 76fd6af8937397407aca836ce2ffcf8d08219e07
Author: Olivier Hallot 
AuthorDate: Mon Nov 4 15:21:15 2024 +0200
Commit: Olivier Hallot 
CommitDate: Mon Nov 4 14:44:20 2024 +0100

Typos

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

diff --git a/source/text/scalc/01/04060107.xhp 
b/source/text/scalc/01/04060107.xhp
index 98b651b663..5b040ce481 100644
--- a/source/text/scalc/01/04060107.xhp
+++ b/source/text/scalc/01/04060107.xhp
@@ -1102,8 +1102,7 @@
   =SUMPRODUCT(A1:B3;C1:D3) returns 397.
   Calculation: 
A1*C1 + B1*D1 + A2*C2 + B2*D2 + A3*C3 + B3*D3
   You can use 
SUMPRODUCT to calculate the scalar product of two vectors.
-  SUMPRODUCT returns a single number, it is not 
necessary to enter th
-e function as an array function.
+  SUMPRODUCT returns a single number, it is not 
necessary to enter the function as an array function.
   
 
 


core.git: sc/inc sc/qa sc/source

2024-11-04 Thread Balazs Varga (via logerrit)
 sc/inc/lookupcache.hxx |   24 +
 sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods |  266 -
 sc/source/core/tool/interpr1.cxx   |2 
 sc/source/core/tool/lookupcache.cxx|   11 
 4 files changed, 227 insertions(+), 76 deletions(-)

New commits:
commit 223696267759326af4e436e0330026e4ff8ee8e0
Author: Balazs Varga 
AuthorDate: Sun Nov 3 19:34:57 2024 +0100
Commit: Balazs Varga 
CommitDate: Mon Nov 4 14:51:35 2024 +0100

tdf#163736 - sc: fix searchmode cached values for lookup functions

Check the search mode option in cache for lookup functions, because
different search modes can produce different results.

Change-Id: I6127a644dc4eae6fad909a6bc83bde2c66e85201
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175972
Reviewed-by: Regina Henschel 
Reviewed-by: Balazs Varga 
Tested-by: Jenkins

diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx
index ca1d333880fa..00194ebd162c 100644
--- a/sc/inc/lookupcache.hxx
+++ b/sc/inc/lookupcache.hxx
@@ -56,6 +56,14 @@ public:
 GREATER_EQUAL
 };
 
+enum SearchMode
+{
+SEARCHFWD = 1,
+SEARCHREV = -1,
+SEARCHBASC = 2,
+SEARCHDESC = -2
+};
+
 class QueryCriteria
 {
 union
@@ -66,6 +74,7 @@ public:
 boolmbAlloc;
 boolmbString;
 QueryOp meOp;
+SearchMode  meSearchMode;
 
 void deleteString()
 {
@@ -77,11 +86,12 @@ public:
 
 public:
 
-explicit QueryCriteria( const ScQueryEntry & rEntry );
+explicit QueryCriteria( const ScQueryEntry & rEntry, sal_Int8 
nSearchMode );
 QueryCriteria( const QueryCriteria & r );
 ~QueryCriteria();
 
 QueryOp getQueryOp() const { return meOp; }
+SearchMode getSearchMode() const { return meSearchMode; }
 
 void setDouble( double fVal )
 {
@@ -99,7 +109,7 @@ public:
 
 bool operator==( const QueryCriteria & r ) const
 {
-return meOp == r.meOp && mbString == r.mbString &&
+return meOp == r.meOp && meSearchMode == r.meSearchMode && 
mbString == r.mbString &&
 (mbString ? (*mpStr == *r.mpStr) : (mfVal == r.mfVal));
 }
 
@@ -153,17 +163,20 @@ private:
 SCROW   mnRow;
 SCTAB   mnTab;
 QueryOp meOp;
+SearchMode  meSearchMode;
 
-QueryKey( const ScAddress & rAddress, const QueryOp eOp ) :
+QueryKey( const ScAddress & rAddress, const QueryOp eOp, SearchMode 
eSearchMode ) :
 mnRow( rAddress.Row()),
 mnTab( rAddress.Tab()),
-meOp( eOp)
+meOp( eOp),
+meSearchMode( eSearchMode)
 {
 }
 
 bool operator==( const QueryKey & r ) const
 {
-return mnRow == r.mnRow && mnTab == r.mnTab && meOp == r.meOp && 
meOp != UNKNOWN;
+return mnRow == r.mnRow && mnTab == r.mnTab && meOp == r.meOp && 
meOp != UNKNOWN &&
+meSearchMode == r.meSearchMode;
 }
 
 struct Hash
@@ -172,6 +185,7 @@ private:
 {
 return (static_cast(r.mnTab) << 24) ^
 (static_cast(r.meOp) << 22) ^
+(static_cast(r.meSearchMode) << 20) ^
 static_cast(r.mnRow);
 }
 };
diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods
index 7ba23d505bb3..c5156957acde 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods
@@ -1,7 +1,7 @@
 
 
-http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:calcext="urn:org:documentfoundation:name

core.git: svx/source

2024-11-04 Thread Sakura286 (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 060d2fe39f27ffbb0e843de5031f6806c9abfce8
Author: Sakura286 
AuthorDate: Thu Oct 24 16:21:52 2024 +0800
Commit: Hossein 
CommitDate: Mon Nov 4 17:32:51 2024 +0100

tdf#147906: Use hypot in place of sqrt to avoid overflow

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index ab33b589b5d2..03ddf6e7ed3e 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -839,7 +839,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 Point aPoint = rOutlinePoly.GetPoint(nPointIdx2)
- rOutlinePoly.GetPoint(nPointIdx1);
 
-double fLen = sqrt(aPoint.X() * aPoint.X() + 
aPoint.Y() * aPoint.Y());
+double fLen = hypot(aPoint.X(), aPoint.Y());
 
 if (fLen > 0)
 {
@@ -878,7 +878,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 //calculate distances between points on 
the outer outline
 const double fDx = vCurOutline[i].X() - 
vCurOutline[i - 1].X();
 const double fDy = vCurOutline[i].Y() - 
vCurOutline[i - 1].Y();
-vCurDistances[i] = sqrt(fDx * fDx + fDy * 
fDy);
+vCurDistances[i] = hypot(fDx, fDy);
 }
 else
 vCurDistances[i] = 0;