core.git: svx/source

2024-11-05 Thread Stephan Bergmann (via logerrit)
 svx/source/svdraw/svdotextdecomposition.cxx |2 +-
 svx/source/svdraw/svdotextpathdecomposition.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit dc9dcb5c00503a8b82f7f6cc73097332ea3b802b
Author: Stephan Bergmann 
AuthorDate: Tue Nov 5 12:39:22 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 6 08:24:15 2024 +0100

loplugin:redundantcast

...after 11b15571475414ef853e21a6c96afa2ac81f848f "convert KernArray from
sal_Int32 to double"

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

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 2c04df143f8e..9d2fe097a84a 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -299,7 +299,7 @@ namespace
 aDXArray.reserve(rInfo.mnTextLen);
 for(sal_Int32 a=0; a < rInfo.mnTextLen; a++)
 {
-aDXArray.push_back(static_cast(rInfo.mpDXArray[a]));
+aDXArray.push_back(rInfo.mpDXArray[a]);
 }
 }
 
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx 
b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 0918528ce310..cc14d78c47ac 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -81,7 +81,7 @@ namespace
 
 for(sal_Int32 a=0; a < mnTextLength; a++)
 {
-
maDblDXArray.push_back(static_cast(rInfo.mpDXArray[a]));
+maDblDXArray.push_back(rInfo.mpDXArray[a]);
 }
 }
 }


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;


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: 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: 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-03 Thread Bogdan Buzea (via logerrit)
 svx/source/svdraw/svdhdl.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 7455410b07183a843566d3ad8e8f66c564cd0a73
Author: Bogdan Buzea 
AuthorDate: Sun Oct 20 20:56:56 2024 +0200
Commit: David Gilbert 
CommitDate: Sun Nov 3 13:16:59 2024 +0100

tdf#163486: PVS: Identical branches

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

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

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 5666c1c03993..aba506b0e463 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -838,14 +838,10 @@ std::unique_ptr 
SdrHdl::CreateOverlayObject(
 case BitmapMarkerKind::Elli_9x11: eNextBigger = 
BitmapMarkerKind::Elli_11x9;break;
 case BitmapMarkerKind::Elli_11x9: eNextBigger = 
BitmapMarkerKind::Elli_9x11;break;
 case BitmapMarkerKind::RectPlus_11x11:eNextBigger = 
BitmapMarkerKind::Rect_13x13;   break;
-
-case BitmapMarkerKind::Crosshair:
-eNextBigger = BitmapMarkerKind::Glue;
-break;
-
 case BitmapMarkerKind::Glue:
 eNextBigger = BitmapMarkerKind::Crosshair;
 break;
+case BitmapMarkerKind::Crosshair:
 case BitmapMarkerKind::Glue_Deselected:
 eNextBigger = BitmapMarkerKind::Glue;
 break;


core.git: svx/source

2024-10-31 Thread Bogdan Buzea (via logerrit)
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx |8 
 1 file changed, 8 deletions(-)

New commits:
commit 6bd9f1f93301756bdc6fa57911d163e9fa5ad313
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 11:31:53 2024 +0200
Commit: David Gilbert 
CommitDate: Fri Nov 1 02:16:15 2024 +0100

tdf#163486: PVS: Identical branches

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

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

diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index b7c70389aa1f..269946d8f852 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -75,14 +75,6 @@ void ParaPropertyPanel::HandleContextChange (
 {
 case CombinedEnumContext(Application::Calc, Context::DrawText):
 case CombinedEnumContext(Application::WriterVariants, 
Context::DrawText):
-mxTBxVertAlign->show();
-mxTBxBackColor->hide();
-mxTBxNumBullet->hide();
-set_hyphenation_base_visible(false);
-set_hyphenation_other_visible(false);
-ReSize();
-break;
-
 case CombinedEnumContext(Application::DrawImpress, Context::Draw):
 case CombinedEnumContext(Application::DrawImpress, 
Context::TextObject):
 case CombinedEnumContext(Application::DrawImpress, Context::Graphic):


core.git: svx/source

2024-10-29 Thread Andrea Gelmini (via logerrit)
 svx/source/svdraw/svdetc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 54a836fa5af3428d893cffe5d7a0963b092e9f70
Author: Andrea Gelmini 
AuthorDate: Tue Oct 29 00:04:55 2024 +0100
Commit: Julien Nabet 
CommitDate: Tue Oct 29 10:12:43 2024 +0100

Fix typo

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

diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index e3dcb280e92f..18db17c23310 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -332,10 +332,10 @@ std::optional GetDraftFillColor(const SfxItemSet& 
rSet)
 Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
 
 // https://en.wikipedia.org/wiki/Alpha_compositing
-// We are here calculating transperency fill color against background with
+// We are here calculating transparency fill color against background with
 // To put it is simple words with example
 // I.E: fill is Red (FF) and background is pure white (FF)
-// If we add 50% transperency to fill color will look like Pink(ff)
+// If we add 50% transparency to fill color will look like Pink(ff)
 
 // TODO: calculate this colors based on object in background  and not just 
the doc color
 aResult.SetRed(


core.git: svx/source

2024-10-28 Thread Pranam Lashkari (via logerrit)
 svx/source/svdraw/svdetc.cxx |   42 +++---
 1 file changed, 35 insertions(+), 7 deletions(-)

New commits:
commit 65fea94ac08fa9f428250098aa527ab072a378f3
Author: Pranam Lashkari 
AuthorDate: Fri Oct 25 10:56:37 2024 +0530
Commit: Pranam Lashkari 
CommitDate: Mon Oct 28 14:21:03 2024 +0100

tdf#163467 svx: calculate fill color with transparency

calculate absolutely visible color based on transparency against the doc 
background

TODO:
calculate this color based on the object in the background to increase 
visibility more

Change-Id: I56076c29f10c58c6ee13e1358da92a4685ea01e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175621
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit f8c87d617fc684e8e204a17cbd119c179a7e86e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175616
Tested-by: Jenkins
Reviewed-by: Pranam Lashkari 

diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index f6b79cb4b5b7..e3dcb280e92f 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -242,12 +243,13 @@ bool OLEObjCache::UnloadObj(SdrOle2Obj& rObj)
 std::optional GetDraftFillColor(const SfxItemSet& rSet)
 {
 drawing::FillStyle eFill=rSet.Get(XATTR_FILLSTYLE).GetValue();
-
+Color aResult;
 switch(eFill)
 {
 case drawing::FillStyle_SOLID:
 {
-return rSet.Get(XATTR_FILLCOLOR).GetColorValue();
+aResult = rSet.Get(XATTR_FILLCOLOR).GetColorValue();
+break;
 }
 case drawing::FillStyle_HATCH:
 {
@@ -262,14 +264,16 @@ std::optional GetDraftFillColor(const SfxItemSet& 
rSet)
 }
 
 const basegfx::BColor 
aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor()));
-return Color(aAverageColor);
+aResult = Color(aAverageColor);
+break;
 }
 case drawing::FillStyle_GRADIENT: {
 const basegfx::BGradient& 
rGrad=rSet.Get(XATTR_FILLGRADIENT).GetGradientValue();
 Color aCol1(Color(rGrad.GetColorStops().front().getStopColor()));
 Color aCol2(Color(rGrad.GetColorStops().back().getStopColor()));
 const basegfx::BColor 
aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor()));
-return Color(aAverageColor);
+aResult = Color(aAverageColor);
+break;
 }
 case drawing::FillStyle_BITMAP:
 {
@@ -309,14 +313,38 @@ std::optional GetDraftFillColor(const SfxItemSet& 
rSet)
 nGn /= nCount;
 nBl /= nCount;
 
-return Color(sal_uInt8(nRt), sal_uInt8(nGn), sal_uInt8(nBl));
+aResult = Color(sal_uInt8(nRt), sal_uInt8(nGn), 
sal_uInt8(nBl));
 }
 break;
 }
-default: break;
+default:
+return {};
 }
 
-return {};
+sal_uInt16 nTransparencyPercentage = 
rSet.Get(XATTR_FILLTRANSPARENCE).GetValue();
+if (!nTransparencyPercentage)
+return aResult;
+
+auto nTransparency = nTransparencyPercentage / 100.0;
+auto nOpacity = 1 - nTransparency;
+
+svtools::ColorConfig aColorConfig;
+Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
+
+// https://en.wikipedia.org/wiki/Alpha_compositing
+// We are here calculating transperency fill color against background with
+// To put it is simple words with example
+// I.E: fill is Red (FF) and background is pure white (FF)
+// If we add 50% transperency to fill color will look like Pink(ff)
+
+// TODO: calculate this colors based on object in background  and not just 
the doc color
+aResult.SetRed(
+std::min(aResult.GetRed() * nOpacity + aBackground.GetRed() * 
nTransparency, 255.0));
+aResult.SetGreen(
+std::min(aResult.GetGreen() * nOpacity + aBackground.GetGreen() * 
nTransparency, 255.0));
+aResult.SetBlue(
+std::min(aResult.GetBlue() * nOpacity + aBackground.GetBlue() * 
nTransparency, 255.0));
+return aResult;
 }
 
 std::unique_ptr SdrMakeOutliner(OutlinerMode nOutlinerMode, 
SdrModel& rModel)


core.git: svx/source

2024-10-26 Thread Bogdan Buzea (via logerrit)
 svx/source/unodraw/unopage.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit c0dc8022f2d4adbc1f47a6f74e3ac69587f8ab24
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 17:03:58 2024 +0200
Commit: David Gilbert 
CommitDate: Sun Oct 27 01:13:55 2024 +0200

tdf#163486: PVS: Identical branches

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

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

diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index dea32b511d39..e516e990cf80 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -640,6 +640,7 @@ rtl::Reference 
SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n
 pRet = new SvxShapePolyPolygon( pObj );
 break;
 case SdrObjKind::Rectangle:
+case SdrObjKind::Annotation:
 pRet = new SvxShapeRect( pObj );
 break;
 case SdrObjKind::CircleOrEllipse:
@@ -766,9 +767,6 @@ rtl::Reference 
SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind n
 case SdrObjKind::Table:
 pRet = new SvxTableShape( pObj );
 break;
-case SdrObjKind::Annotation:
-pRet = new SvxShapeRect( pObj );
-break;
 default: // unknown 2D-object on page
 assert(false && "Not implemented Starone-Shape created");
 pRet = new SvxShapeText( pObj );


core.git: svx/source

2024-10-23 Thread Xisco Fauli (via logerrit)
 svx/source/fmcomp/fmgridcl.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit f6fc9dd338751f8d14ce66024238976fa7259fcc
Author: Xisco Fauli 
AuthorDate: Wed Oct 23 01:01:03 2024 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 23 09:25:22 2024 +0200

tdf#163486: PVS: Expression is always true

V560A part of conditional expression is always true: pItem.

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

diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 8e91cbb56a35..4ed389f68ac7 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -800,10 +800,9 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 
nColId, weld::Menu& rM
 std::unique_ptr pItem;
 SfxItemState eState = 
pCurrentFrame->GetBindings().QueryState(SID_FM_CTL_PROPERTIES, pItem);
 
-if (eState >= SfxItemState::DEFAULT && pItem != nullptr)
+if (eState >= SfxItemState::DEFAULT && pItem)
 {
-bool bChecked = pItem && pItem->GetValue();
-rMenu.set_active(u"column"_ustr, bChecked);
+rMenu.set_active(u"column"_ustr, pItem->GetValue());
 }
 }
 }


core.git: svx/source

2024-10-22 Thread Julien Nabet (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx |   20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

New commits:
commit b2d35dfe19aec40d34f1a2cca0a83ef4cef23a7d
Author: Julien Nabet 
AuthorDate: Sat Oct 19 18:43:02 2024 +0200
Commit: Julien Nabet 
CommitDate: Tue Oct 22 17:14:02 2024 +0200

tdf#163284: Diagonal/criss-cross borders for tables is only implemented in 
Calc

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 6cab2fac0af4..4380fbc2fe6c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -485,6 +485,7 @@ private:
 std::vector> aImgVec;
 boolbParagraphMode;
 boolm_bIsWriter;
+boolm_bIsCalc;
 
 void InitImageList();
 void CalcSizeValueSet();
@@ -2471,11 +2472,16 @@ 
SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl, weld:
 , mxFrameSetWin(new weld::CustomWeld(*m_xBuilder, u"valueset"_ustr, 
*mxFrameSet))
 , bParagraphMode(false)
 , m_bIsWriter(false)
+, m_bIsCalc(false)
 {
 
 // check whether the document is Writer or not
+// check also if it's Calc or not
 if (Reference xSI{ 
m_xFrame->getController()->getModel(), UNO_QUERY })
+{
 m_bIsWriter = 
xSI->supportsService(u"com.sun.star.text.TextDocument"_ustr);
+m_bIsCalc = 
xSI->supportsService(u"com.sun.star.sheet.SpreadsheetDocument"_ustr);
+}
 
 mxFrameSet->SetStyle(WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | 
WB_NO_DIRECTSELECT);
 AddStatusListener(u".uno:BorderReducedMode"_ustr);
@@ -2495,14 +2501,14 @@ 
SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl, weld:
 // diagonal borders available only for Calc.
 // Therefore, Calc uses 10 border types while
 // Writer uses 8 of them - for a single cell.
-for ( i=1; i < (m_bIsWriter ? 9 : 11); i++ )
+for ( i=1; i < (m_bIsCalc ? 11 : 9); i++ )
 mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), 
aImgVec[i-1].second);
 
 //bParagraphMode should have been set in StateChanged
 if ( !bParagraphMode )
 // when multiple cell selected:
 // Writer has 12 border types and Calc has 15 of them.
-for ( i = (m_bIsWriter ? 9 : 11); i < (m_bIsWriter ? 13 : 16); i++ )
+for ( i = (m_bIsCalc ? 11 : 9); i < (m_bIsCalc ? 16 : 13); i++ )
 mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), 
aImgVec[i-1].second);
 
 // adjust frame column for Writer
@@ -2568,7 +2574,7 @@ IMPL_LINK_NOARG(SvxFrameWindow_Impl, SelectHdl, 
ValueSet*, void)
 // nSel has 15 cases which means 15 border
 // types for Calc. But Writer uses only 12
 // of them - when diagonal borders excluded.
-if (m_bIsWriter)
+if (!m_bIsCalc)
 {
 // add appropriate increments
 // to match the correct borders.
@@ -2735,7 +2741,7 @@ void SvxFrameWindow_Impl::statusChanged( const 
css::frame::FeatureStateEvent& rE
 return;
 
 // set 12 border types for Writer, otherwise 15 for Calc.
-bool bTableMode = ( mxFrameSet->GetItemCount() == 
static_cast(m_bIsWriter ? 12 : 15) );
+bool bTableMode = ( mxFrameSet->GetItemCount() == 
static_cast(m_bIsCalc ? 15 : 12) );
 bool bResize= false;
 
 if ( bTableMode && bParagraphMode )
@@ -2769,10 +2775,10 @@ void SvxFrameWindow_Impl::CalcSizeValueSet()
 
 void SvxFrameWindow_Impl::InitImageList()
 {
-if (m_bIsWriter)
+if (!m_bIsCalc)
 {
-// Writer-specific aImgVec.
-// Since Writer doesn't have diagonal borders,
+// not Writer/Impress/Draw-specific aImgVec.
+// Since they don't have diagonal borders,
 // we have to use 12 border types here.
 aImgVec = {
 {BitmapEx(RID_SVXBMP_FRAME1), 
SvxResId(RID_SVXSTR_TABLE_PRESET_NONE)},


core.git: svx/source

2024-10-22 Thread Bogdan Buzea (via logerrit)
 svx/source/customshapes/EnhancedCustomShape2d.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 14a3ed6149c54e214569a292b2d0bbc5e09aeaff
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 17:53:24 2024 +0200
Commit: Xisco Fauli 
CommitDate: Tue Oct 22 12:14:06 2024 +0200

tdf#163486: PVS: Identical branches

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

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

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 644eee59dad7..49fd4d45110b 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1044,10 +1044,6 @@ void EnhancedCustomShape2d::GetParameter( double& 
rRetValue, const EnhancedCusto
 }
 break;
 case EnhancedCustomShapeParameterType::LEFT :
-{
-rRetValue  = 0.0;
-}
-break;
 case EnhancedCustomShapeParameterType::TOP :
 {
 rRetValue  = 0.0;


core.git: svx/source

2024-10-21 Thread Bogdan Buzea (via logerrit)
 svx/source/dialog/ctredlin.cxx |   13 -
 1 file changed, 13 deletions(-)

New commits:
commit 729716c737f43cf93601aa028cd1967de31052c4
Author: Bogdan Buzea 
AuthorDate: Mon Oct 21 08:40:02 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 21 12:13:22 2024 +0200

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 194, 
200
V1037 Two or more case-branches perform the same actions. Check lines: 796, 
800
V1037 Two or more case-branches perform the same actions. Check lines: 804, 
810

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

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 66d00c9e7ecb..cdcdeed1ff2a 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -191,11 +191,6 @@ void SvxRedlinTable::UpdateFilterTest()
 aDaTiFilterLast=aDTMax;
 break;
 case SvxRedlinDateMode::EQUAL:
-aDaTiFilterFirst=aDaTiFirst;
-aDaTiFilterLast=aDaTiFirst;
-aDaTiFilterFirst.SetTime(aTMin.GetTime());
-aDaTiFilterLast.SetTime(aTMax.GetTime());
-break;
 case SvxRedlinDateMode::NOTEQUAL:
 aDaTiFilterFirst=aDaTiFirst;
 aDaTiFilterLast=aDaTiFirst;
@@ -793,19 +788,11 @@ IMPL_LINK_NOARG(SvxTPFilter, SelDateHdl, weld::ComboBox&, 
void)
 switch(nKind)
 {
 case SvxRedlinDateMode::BEFORE:
-EnableDateLine1(true);
-EnableDateLine2(false);
-break;
 case SvxRedlinDateMode::SINCE:
 EnableDateLine1(true);
 EnableDateLine2(false);
 break;
 case SvxRedlinDateMode::EQUAL:
-EnableDateLine1(true);
-m_xTfDate->set_sensitive(false);
-m_xTfDate->set_text(OUString());
-EnableDateLine2(false);
-break;
 case SvxRedlinDateMode::NOTEQUAL:
 EnableDateLine1(true);
 m_xTfDate->set_sensitive(false);


core.git: svx/source

2024-10-20 Thread Chizoba ODINAKA (via logerrit)
 svx/source/gallery2/codec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e1a882e82331e3ee301332e3d10b36b5620073f9
Author: Chizoba ODINAKA 
AuthorDate: Sat Oct 19 20:19:15 2024 +0100
Commit: David Gilbert 
CommitDate: Sun Oct 20 22:34:17 2024 +0200

tdf#75280 Convert sal_uIntPtr to size_t a more appropriate integer type

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

diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx
index 062c60dbecc6..5c549bd80173 100644
--- a/svx/source/gallery2/codec.cxx
+++ b/svx/source/gallery2/codec.cxx
@@ -98,7 +98,7 @@ void GalleryCodec::Read( SvStream& rStmToRead )
 std::unique_ptr pOutBuf(new sal_uInt8[ nUnCompressedSize 
]);
 sal_uInt8*  pTmpBuf = pOutBuf.get();
 sal_uInt8*  pLast = pOutBuf.get() + nUnCompressedSize - 1;
-sal_uIntPtr   nIndex = 0, nCountByte, nRunByte;
+size_t   nIndex = 0, nCountByte, nRunByte;
 boolbEndDecoding = false;
 
 do


core.git: svx/source

2024-10-20 Thread Xisco Fauli (via logerrit)
 svx/source/dialog/srchdlg.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2219d42ca36ff0b49a488da9198384d8673096fa
Author: Xisco Fauli 
AuthorDate: Sun Oct 20 20:17:10 2024 +0200
Commit: Xisco Fauli 
CommitDate: Sun Oct 20 21:59:02 2024 +0200

tdf#163486: PVS: identical sub-expressions

Since
commit 78010a4db197ac44fb729a122464847931ee0e5b
Author: Caolán McNamara 
Date:   Thu Oct 4 15:37:14 2018 +0100

Resolves: tdf#106340 resize dialog when search/replace labels are 
shown/hidden

V501There are identical sub-expressions 
'!m_xReplaceAttrText->get_visible()' to the left and to the right of the '||' 
operator.
V501There are identical sub-expressions 
'!m_xReplaceAttrText->get_visible()' to the left and to the right of the '||' 
operator.

Change-Id: Ib62557af291679c253162e3d72a39659691ef0b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175285
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index ef32b558b50b..480042ea2ce7 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1528,7 +1528,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, TemplateHdl_Impl, 
weld::Toggleable&, void)
 
 if(!sDesc.isEmpty())
 {
-if (!m_xReplaceAttrText->get_visible() || 
!m_xReplaceAttrText->get_visible())
+if (!m_xSearchAttrText->get_visible() || 
!m_xReplaceAttrText->get_visible())
 {
 m_xSearchAttrText->show();
 m_xReplaceAttrText->show();
@@ -1559,7 +1559,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, TemplateHdl_Impl, 
weld::Toggleable&, void)
 
 if(!sDesc.isEmpty())
 {
-if (!m_xReplaceAttrText->get_visible() || 
!m_xReplaceAttrText->get_visible())
+if (!m_xSearchAttrText->get_visible() || 
!m_xReplaceAttrText->get_visible())
 {
 m_xSearchAttrText->show();
 m_xReplaceAttrText->show();


core.git: svx/source

2024-10-15 Thread Xisco Fauli (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2e2d0a65e349d78f18bc2157569dab687d6165e9
Author: Xisco Fauli 
AuthorDate: Tue Oct 15 16:06:41 2024 +0200
Commit: Xisco Fauli 
CommitDate: Tue Oct 15 18:08:54 2024 +0200

svx: check SfxObjectShell::Current()

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 31e0fdc3f109..6cab2fac0af4 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3932,9 +3932,9 @@ namespace
 
 std::vector aCurrencyIDs;
 
-SfxObjectShell* pDocShell = SfxObjectShell::Current();
-if (auto pModelAccessor = pDocShell->GetDocumentModelAccessor())
-aCurrencyIDs = pModelAccessor->getDocumentCurrencies();
+if (SfxObjectShell* pDocShell = SfxObjectShell::Current())
+if (auto pModelAccessor = 
pDocShell->GetDocumentModelAccessor())
+aCurrencyIDs = pModelAccessor->getDocumentCurrencies();
 
 SvxCurrencyToolBoxControl::GetCurrencySymbols(aList, true, 
aCurrencyList, aCurrencyIDs);
 


core.git: svx/source

2024-10-14 Thread Michael Weghorn (via logerrit)
 svx/source/dialog/weldeditview.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8bb38e1b3f1ba1d9c563598d161230fdf27e4685
Author: Michael Weghorn 
AuthorDate: Mon Oct 14 12:22:32 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 15 08:10:36 2024 +0200

tdf#163397 svx: Use field color for WeldEditView bg

Use field color instead of the window color
for the WeldEditView background.

This is consistent with the color used for the other
text edit controls like the VCL Edit, see
Edit::ApplySettings.

While field and window color are the same color for e.g.
gtk3 or gen, they're different colors for macOS and
Qt-based VCL plugins, at least when using the Breeze
style that's default on KDE Plasma.

With this commit in place, the background color becomes
white for macOS and Linux with the qt5 VCL plugin with the
Breeze style.

For the latter, this had changed to light grey with

commit 9dd26d7a2cc6b314dcc0b52000e0475bb4ced57d
Date:   Thu Sep 5 01:37:44 2024 +0530

Libreoffice Theme Part 0: Read correct colors from qt based 
VCL_PLUGINS

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

diff --git a/svx/source/dialog/weldeditview.cxx 
b/svx/source/dialog/weldeditview.cxx
index 14767992e9c2..2f1ff16a862d 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -1571,7 +1571,7 @@ void WeldEditView::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 EnableRTL(false);
 
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
-Color aBgColor = rStyleSettings.GetWindowColor();
+Color aBgColor = rStyleSettings.GetFieldColor();
 
 OutputDevice& rDevice = pDrawingArea->get_ref_device();
 


core.git: svx/source

2024-10-12 Thread Noel Grandin (via logerrit)
 svx/source/svdraw/svdedxv.cxx |   58 --
 1 file changed, 28 insertions(+), 30 deletions(-)

New commits:
commit 7970ad40041b87a6ddb6829271208fe3993ed01c
Author: Noel Grandin 
AuthorDate: Thu Oct 10 19:48:53 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 12 11:36:00 2024 +0200

cid#1608328 Overflowed constant

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

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index fd6315976a5e..ef877e45cd70 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2812,36 +2812,34 @@ void SdrObjEditView::OnEndPasteOrDrop(PasteOrDropInfos*)
 
 sal_uInt16 SdrObjEditView::GetSelectionLevel() const
 {
-sal_uInt16 nLevel = 0x;
-if (IsTextEdit())
-{
-DBG_ASSERT(mpTextEditOutlinerView != nullptr,
-   "SdrObjEditView::GetAttributes(): 
mpTextEditOutlinerView=NULL");
-DBG_ASSERT(mpTextEditOutliner != nullptr,
-   "SdrObjEditView::GetAttributes(): mpTextEditOutliner=NULL");
-if (mpTextEditOutlinerView)
-{
-//start and end position
-ESelection aSelect = mpTextEditOutlinerView->GetSelection();
-sal_uInt16 nStartPara = ::std::min(aSelect.nStartPara, 
aSelect.nEndPara);
-sal_uInt16 nEndPara = ::std::max(aSelect.nStartPara, 
aSelect.nEndPara);
-//get level from each paragraph
-nLevel = 0;
-for (sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++)
-{
-sal_uInt16 nParaDepth
-= 1 << 
static_cast(mpTextEditOutliner->GetDepth(nPara));
-if (!(nLevel & nParaDepth))
-nLevel += nParaDepth;
-}
-//reduce one level for Outliner Object
-//if( nLevel > 0 && GetTextEditObject()->GetObjIdentifier() == 
OBJ_OUTLINETEXT )
-//  nLevel = nLevel >> 1;
-//no bullet paragraph selected
-if (nLevel == 0)
-nLevel = 0x;
-}
-}
+if (!IsTextEdit())
+return 0x;
+DBG_ASSERT(mpTextEditOutlinerView != nullptr,
+   "SdrObjEditView::GetAttributes(): mpTextEditOutlinerView=NULL");
+DBG_ASSERT(mpTextEditOutliner != nullptr,
+   "SdrObjEditView::GetAttributes(): mpTextEditOutliner=NULL");
+if (!mpTextEditOutlinerView)
+return 0x;
+//start and end position
+ESelection aSelect = mpTextEditOutlinerView->GetSelection();
+sal_uInt16 nStartPara = ::std::min(aSelect.nStartPara, aSelect.nEndPara);
+sal_uInt16 nEndPara = ::std::max(aSelect.nStartPara, aSelect.nEndPara);
+//get level from each paragraph
+sal_uInt16 nLevel = 0;
+for (sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++)
+{
+sal_Int16 nDepth = mpTextEditOutliner->GetDepth(nPara);
+assert(nDepth >= 0 && nDepth <= 15);
+sal_uInt16 nParaDepth = 1 << static_cast(nDepth);
+if (!(nLevel & nParaDepth))
+nLevel += nParaDepth;
+}
+//reduce one level for Outliner Object
+//if( nLevel > 0 && GetTextEditObject()->GetObjIdentifier() == 
OBJ_OUTLINETEXT )
+//  nLevel = nLevel >> 1;
+//no bullet paragraph selected
+if (nLevel == 0)
+nLevel = 0x;
 return nLevel;
 }
 


core.git: svx/source

2024-10-03 Thread Noel Grandin (via logerrit)
 svx/source/form/fmscriptingenv.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 2be7689549ca126de2cb404e79f60c3f503a51fd
Author: Noel Grandin 
AuthorDate: Wed Oct 2 19:50:33 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 3 16:56:27 2024 +0200

cid#1606754 Thread deadlock

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

diff --git a/svx/source/form/fmscriptingenv.cxx 
b/svx/source/form/fmscriptingenv.cxx
index cf567083b6a0..8012319f5e33 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -917,10 +917,15 @@ namespace svxform
 
 void FormScriptingEnvironment::dispose()
 {
-std::unique_lock aGuard( m_aMutex );
-m_bDisposed = true;
-m_pScriptListener->dispose();
-m_pScriptListener.clear();
+rtl::Reference xListener;
+{
+std::unique_lock aGuard( m_aMutex );
+if (m_bDisposed)
+return;
+m_bDisposed = true;
+xListener = std::move(m_pScriptListener);
+}
+xListener->dispose();
 }
 
 }


core.git: svx/source

2024-10-03 Thread Noel Grandin (via logerrit)
 svx/source/unodraw/unoshcol.cxx |   62 
 1 file changed, 25 insertions(+), 37 deletions(-)

New commits:
commit 16569ed32638464b4b6857fc2c29f59a919baed7
Author: Noel Grandin 
AuthorDate: Wed Oct 2 19:46:27 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 3 15:46:47 2024 +0200

simplify SvxShapeCollection::dispose

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

diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 3a58ab514ff3..280dd23f98cf 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -76,52 +76,40 @@ void SvxShapeCollection::dispose()
 
 // Guard dispose against multiple threading
 // Remark: It is an error to call dispose more than once
-bool bDoDispose = false;
 {
 std::unique_lock aGuard( m_aMutex );
-if( !bDisposed && !bInDispose )
-{
-// only one call go into this section
-bInDispose = true;
-bDoDispose = true;
-}
+if( bDisposed || bInDispose )
+return;
+// only one call go into this section
+bInDispose = true;
 }
 
 // Do not hold the mutex because we are broadcasting
-if( bDoDispose )
+// Create an event with this as sender
+try
 {
-// Create an event with this as sender
-try
-{
-document::EventObject aEvt;
-aEvt.Source = uno::Reference< uno::XInterface >::query( 
static_cast(this) );
-// inform all listeners to release this object
-// The listener container are automatically cleared
-std::unique_lock g(m_aMutex);
-maEventListeners.disposeAndClear( g, aEvt );
-maShapeContainer.clear();
-}
-catch(const css::uno::Exception&)
-{
-// catch exception and throw again but signal that
-// the object was disposed. Dispose should be called
-// only once.
-bDisposed = true;
-bInDispose = false;
-throw;
-}
-
-// the values bDispose and bInDisposing must set in this order.
-// No multithread call overcome the "!rBHelper.bDisposed && 
!rBHelper.bInDispose" guard.
-bDisposed = true;
-bInDispose = false;
+document::EventObject aEvt;
+aEvt.Source = uno::Reference< uno::XInterface >::query( 
static_cast(this) );
+// inform all listeners to release this object
+// The listener container are automatically cleared
+std::unique_lock g(m_aMutex);
+maEventListeners.disposeAndClear( g, aEvt );
+maShapeContainer.clear();
 }
-else
+catch(const css::uno::Exception&)
 {
-// in a multithreaded environment, it can't be avoided, that dispose 
is called twice.
-// However this condition is traced, because it MAY indicate an error.
-SAL_INFO("svx", "dispose called twice" );
+// catch exception and throw again but signal that
+// the object was disposed. Dispose should be called
+// only once.
+bDisposed = true;
+bInDispose = false;
+throw;
 }
+
+// the values bDispose and bInDisposing must set in this order.
+// No multithread call overcome the "!rBHelper.bDisposed && 
!rBHelper.bInDispose" guard.
+bDisposed = true;
+bInDispose = false;
 }
 
 // XComponent


core.git: svx/source

2024-10-01 Thread Armin Le Grand (allotropia) (via logerrit)
 svx/source/svdraw/svdobj.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3bc4538f4ab76a71ac9f4edc62d32fba8924b637
Author: Armin Le Grand (allotropia) 
AuthorDate: Tue Oct 1 11:19:58 2024 +0200
Commit: Armin Le Grand 
CommitDate: Tue Oct 1 16:54:59 2024 +0200

No broadcast on ObjectChange when in destruction

Saw that on a stack on gerrit, checking if that is
okay for the rest of functionality, should be

Change-Id: Ifa61a54edb46b0c98afc59b77674e3686fa29a59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174311
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 01d120b97acf..c3c143c5d634 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1016,7 +1016,7 @@ void SdrObject::RecalcBoundRect()
 
 void SdrObject::BroadcastObjectChange() const
 {
-if ((getSdrModelFromSdrObject().isLocked()) || comphelper::IsFuzzing())
+if ((getSdrModelFromSdrObject().isLocked()) || 
getSdrModelFromSdrObject().IsInDestruction() || comphelper::IsFuzzing())
 return;
 
 bool bPlusDataBroadcast(m_pPlusData && m_pPlusData->pBroadcast);


core.git: svx/source

2024-09-29 Thread Balazs Varga (via logerrit)
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b566dab48c1448dbc5442b30396e9f6c482f2408
Author: Balazs Varga 
AuthorDate: Thu Sep 26 12:15:46 2024 +0200
Commit: Balazs Varga 
CommitDate: Sun Sep 29 19:58:08 2024 +0200

Related: tdf#161826 - A bit more accurate Glow effect for texts in shapes

With a more accurate exponentiation function the text glow effect, maybe
can be more accurate comaparing to the MSO.

follow-up commit: 3eac847927a0cdfa40c3fea38c473ed2ad7faecc and
5bb5a7ea60c4496d7ad21ad81a0f37f6f5fd2288

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

diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx 
b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index f1628354283d..bf6cdb7c4571 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -246,10 +246,10 @@ namespace drawinglayer
 
 if (nFontSize)
 {
-// Rendering_glow_size = Original_glow_size / (154.39 * 
FontSize ^ -0,621)
+// Rendering_glow_size = Original_glow_size / (154.39 * 
FontSize ^ -0,575)
 // This is an approximate calculation similar to MSO text glow 
size which is
 // depending on font size
-nRadius = nTextRadius / (154.39 * pow(nFontSize, -0.621));
+nRadius = nTextRadius / (154.39 * pow(nFontSize, -0.575));
 nTextRadius = std::round(nRadius);
 }
 


core.git: svx/source

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

New commits:
commit 94a4d30494e2fc31917fc7b32a5a7a8b7dd2c360
Author: Caolán McNamara 
AuthorDate: Tue Sep 10 20:08:22 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 11 09:38:16 2024 +0200

cid#1606920 Overflowed integer argument

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

diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 8b212f199c43..57e47cf8a23c 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1310,7 +1310,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, 
tools::Long nAngle1, co
 pInfo->m_nMiddleLine=nXP1Cnt-1;
 }
 sal_uInt16 nNum=aXP2.GetPointCount();
-if (aXP1[nXP1Cnt-1]==aXP2[nXP2Cnt-1] && nXP1Cnt>1 && nXP2Cnt>1) nNum--;
+if (nXP1Cnt > 1 && nXP2Cnt > 1 && aXP1[nXP1Cnt-1] == aXP2[nXP2Cnt-1]) 
nNum--;
 while (nNum>0) {
 nNum--;
 aXP1.Insert(XPOLY_APPEND,aXP2[nNum],PolyFlags::Normal);


core.git: svx/source

2024-09-11 Thread Caolán McNamara (via logerrit)
 svx/source/gallery2/galbrws1.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e53df700aa6d50003cd86d3190a3e4348f66e240
Author: Caolán McNamara 
AuthorDate: Tue Sep 10 20:04:18 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 11 09:37:52 2024 +0200

cid#1619294 Dereference null return value

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

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 960b9d81d862..e367101fb759 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -287,7 +287,12 @@ void GalleryBrowser1::ImplGalleryThemeProperties( 
std::u16string_view rThemeName
 {
 DBG_ASSERT(!mpThemePropsDlgItemSet, "mpThemePropsDlgItemSet already set!");
 mpThemePropsDlgItemSet.reset(new SfxItemSet( SfxGetpApp()->GetPool() ));
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListener );
+GalleryTheme* pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListener );
+if (!pTheme)
+{
+SAL_WARN("svx", "failed to acquire theme: " << OUString(rThemeName));
+return;
+}
 
 ImplFillExchangeData(*pTheme, *mpExchangeData);
 


core.git: svx/source

2024-09-11 Thread Caolán McNamara (via logerrit)
 svx/source/gallery2/galbrws1.cxx |   10 +-
 svx/source/inc/galbrws1.hxx  |2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit b14a6c9e8d259233ffa666c08e314598932cb3c3
Author: Caolán McNamara 
AuthorDate: Tue Sep 10 20:02:18 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 11 09:37:28 2024 +0200

ImplFillExchangeData always derefs its first arg

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

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index c7c5c59f6727..960b9d81d862 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -223,14 +223,14 @@ void GalleryBrowser1::ImplInsertThemeEntry( const 
GalleryThemeEntry* pEntry )
 mxThemes->append(u""_ustr, pEntry->GetThemeName(), *pImage);
 }
 
-void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, 
ExchangeData& rData )
+void GalleryBrowser1::ImplFillExchangeData(const GalleryTheme& rThm, 
ExchangeData& rData)
 {
-rData.pTheme = const_cast(pThm);
-rData.aEditedTitle = pThm->GetName();
+rData.pTheme = const_cast(&rThm);
+rData.aEditedTitle = rThm.GetName();
 
 try
 {
-DateTime aDateTime(pThm->getModificationDate());
+DateTime aDateTime(rThm.getModificationDate());
 
 rData.aThemeChangeDate = aDateTime;
 rData.aThemeChangeTime = aDateTime;
@@ -289,7 +289,7 @@ void GalleryBrowser1::ImplGalleryThemeProperties( 
std::u16string_view rThemeName
 mpThemePropsDlgItemSet.reset(new SfxItemSet( SfxGetpApp()->GetPool() ));
 GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListener );
 
-ImplFillExchangeData( pTheme, *mpExchangeData );
+ImplFillExchangeData(*pTheme, *mpExchangeData);
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
 VclPtr xThemePropertiesDialog = 
pFact->CreateGalleryThemePropertiesDialog(mxThemes.get(), mpExchangeData.get(), 
mpThemePropsDlgItemSet.get());
diff --git a/svx/source/inc/galbrws1.hxx b/svx/source/inc/galbrws1.hxx
index 2796bbcc2e72..4ec48c5154ff 100644
--- a/svx/source/inc/galbrws1.hxx
+++ b/svx/source/inc/galbrws1.hxx
@@ -138,7 +138,7 @@ private:
 SfxListener maLocalListener;
 
 void ImplInsertThemeEntry(const GalleryThemeEntry* pEntry);
-static void ImplFillExchangeData(const GalleryTheme* pThm, ExchangeData& 
rData);
+static void ImplFillExchangeData(const GalleryTheme& rThm, ExchangeData& 
rData);
 void ImplGetExecuteVector(std::vector& o_aExec);
 void ImplExecute(std::u16string_view rIdent);
 void ImplGalleryThemeProperties(std::u16string_view rThemeName, bool 
bCreateNew);


core.git: svx/source

2024-09-10 Thread Stephan Bergmann (via logerrit)
 svx/source/fmcomp/gridctrl.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit b472e1cedddf083d6b04d233cdefe686c8aa07ae
Author: Stephan Bergmann 
AuthorDate: Tue Sep 10 13:04:00 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 10 18:24:11 2024 +0200

-Werror,-Wunused-private-field

...since f9ff22db058180d161b32f5dcd87e72cfa3b6889 
"tsan:lock-order-inversion in
forms"

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

diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index b891f2081a04..e716d9eeb0ab 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -123,7 +123,6 @@ private:
 
 class GridFieldValueListener : protected ::comphelper::OPropertyChangeListener
 {
-osl::Mutex  m_aMutex;
 DbGridControl&  m_rParent;
 rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_pRealListener;
 sal_uInt16  m_nId;
@@ -240,8 +239,6 @@ class FmXGridSourcePropListener : public 
::comphelper::OPropertyChangeListener
 {
 VclPtr m_pParent;
 
-// a DbGridControl has no mutex, so we use our own as the base class 
expects one
-osl::Mutex  m_aMutex;
 sal_Int16   m_nSuspended;
 
 public:


core.git: svx/source

2024-09-09 Thread Gökay Şatır (via logerrit)
 svx/source/svdraw/svdmrkv.cxx |3 ++-
 svx/source/svdraw/svdpage.cxx |   24 +++-
 2 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 81780168e35dce08e3d30d95eb3b9e65849d5a14
Author: Gökay Şatır 
AuthorDate: Wed Aug 7 17:41:21 2024 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 10 08:40:00 2024 +0200

Simplify GetObjectRectangles function with JSonWriter.

This is a follow up for:
* https://gerrit.libreoffice.org/c/core/+/171374

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 8526e7e51f17..d63556a50d3d 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1228,7 +1228,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 {
 // Send all objects' rectangles along with the selected 
object's information.
 // Other rectangles can be used for aligning the selected 
object referencing the others.
-OString objectRectangles = 
SdrObjList::GetObjectRectangles(*pPage);
+// Replace curly braces with empty string in order to 
merge it with the resulting string.
+OString objectRectangles = 
SdrObjList::GetObjectRectangles(*pPage).replaceAll("{"_ostr, 
""_ostr).replaceAll("}"_ostr, ""_ostr);
 aExtraInfo.append(", \"ObjectRectangles\": "_ostr + 
objectRectangles);
 }
 
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 1cff663e1f08..7618c51c825a 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -130,21 +131,26 @@ SdrObject* SdrObjList::getSdrObjectFromSdrObjList() const
 
 OString SdrObjList::GetObjectRectangles(const SdrObjList& rSrcList)
 {
-OStringBuffer aBuffer("[");
+tools::JsonWriter jsWriter;
 
-for (const rtl::Reference& item: rSrcList)
 {
-if (item->IsPrintable() && item->IsVisible())
+auto array = jsWriter.startAnonArray();
+
+for (const rtl::Reference& item: rSrcList)
 {
-tools::Rectangle rectangle = item->GetCurrentBoundRect();
-aBuffer.append("["_ostr + rectangle.toString() + ", "_ostr + 
OString::number(item->GetOrdNum()) + "]"_ostr);
+if (item->IsPrintable() && item->IsVisible())
+{
+tools::Rectangle rectangle = item->GetCurrentBoundRect();
+OStringBuffer value(OString::number(item->GetOrdNum()));
+value = rectangle.toString() + ", "_ostr + value;
+
+auto subArray = jsWriter.startAnonArray();
+jsWriter.putRaw(value.makeStringAndClear());
+}
 }
 }
 
-OString aResult = aBuffer.makeStringAndClear();
-aResult = aResult.replaceAll("]["_ostr, "],["_ostr);
-
-return aResult + "]"_ostr;
+return jsWriter.finishAndGetAsOString();
 }
 
 void SdrObjList::CopyObjects(const SdrObjList& rSrcList)


core.git: svx/source

2024-09-09 Thread Henry Castro (via logerrit)
 svx/source/items/numfmtsh.cxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 4f2a44849e74074b5c2741a8dec52229cf7d45e4
Author: Henry Castro 
AuthorDate: Thu Sep 5 06:27:26 2024 -0400
Commit: Caolán McNamara 
CommitDate: Mon Sep 9 18:22:04 2024 +0200

Resolves: tdf#162819 fix "NatNum12" preview string format

The default value 0.00 does not translate the appropriative
number literals.

Signed-off-by: Henry Castro 
Change-Id: I6577def4ccc7ff04c6b891a4df9384d1d58f4e8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172909
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
(cherry picked from commit a54bedd7924445abe74748110e54f3901380d469)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173086
Tested-by: Jenkins

diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 61e473d45cd0..740429aa6995 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1101,7 +1102,20 @@ void 
SvxNumberFormatShell::GetPreviewString_Impl(OUString& rString, const Color*
 }
 else
 {
-pFormatter->GetOutputString(nValNum, nCurFormatKey, rString, &rpColor, 
bUseStarFormat);
+double nVal = nValNum;
+const SvNumberformat* pEntry = pFormatter->GetEntry(nCurFormatKey);
+if (nVal == 0.0 && pEntry && 
pEntry->GetFormatstring().indexOf("NatNum12") >= 0)
+{
+sal_Int32 nEnd;
+rtl_math_ConversionStatus eStatus;
+LocaleDataWrapper aLocale(LanguageTag(pEntry->GetLanguage()));
+
+nVal = aLocale.stringToDouble(aValStr, true, &eStatus, &nEnd);
+if (rtl_math_ConversionStatus_Ok != eStatus || nEnd == 0)
+nVal = GetDefaultValNum(pFormatter->GetType(nCurFormatKey));
+}
+
+pFormatter->GetOutputString(nVal, nCurFormatKey, rString, &rpColor, 
bUseStarFormat);
 }
 }
 


core.git: svx/source

2024-09-07 Thread Xisco Fauli (via logerrit)
 svx/source/gallery2/galbrws1.cxx |   24 
 svx/source/inc/galbrws1.hxx  |2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit eef52a368001c4b99381eecde0945601004e55ef
Author: Xisco Fauli 
AuthorDate: Sat Sep 7 18:03:51 2024 +0200
Commit: Caolán McNamara 
CommitDate: Sat Sep 7 21:22:49 2024 +0200

svx: maLocalListner -> maLocalListener

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

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 14d2e841e4e0..e7e3cece147c 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -248,7 +248,7 @@ void GalleryBrowser1::ImplFillExchangeData( const 
GalleryTheme* pThm, ExchangeDa
 
 void GalleryBrowser1::ImplGetExecuteVector(std::vector& o_aExec)
 {
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), maLocalListner );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), maLocalListener );
 
 if( !pTheme )
 return;
@@ -280,14 +280,14 @@ void 
GalleryBrowser1::ImplGetExecuteVector(std::vector& o_aExec)
 
 o_aExec.emplace_back("properties");
 
-mpGallery->ReleaseTheme( pTheme, maLocalListner );
+mpGallery->ReleaseTheme( pTheme, maLocalListener );
 }
 
 void GalleryBrowser1::ImplGalleryThemeProperties( std::u16string_view 
rThemeName, bool bCreateNew )
 {
 DBG_ASSERT(!mpThemePropsDlgItemSet, "mpThemePropsDlgItemSet already set!");
 mpThemePropsDlgItemSet.reset(new SfxItemSet( SfxGetpApp()->GetPool() ));
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListner );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListener );
 
 ImplFillExchangeData( pTheme, *mpExchangeData );
 
@@ -337,7 +337,7 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties(bool 
bCreateNew, sal_Int32 n
 }
 
 OUString aThemeName( mpExchangeData->pTheme->GetName() );
-mpGallery->ReleaseTheme( mpExchangeData->pTheme, maLocalListner );
+mpGallery->ReleaseTheme( mpExchangeData->pTheme, maLocalListener );
 
 if ( bCreateNew && ( nRet != RET_OK ) )
 {
@@ -359,13 +359,13 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 {
 if (rIdent == u"update")
 {
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), maLocalListner );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), maLocalListener );
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
 ScopedVclPtr 
aActualizeProgress(pFact->CreateActualizeProgressDialog(mxThemes.get(), 
pTheme));
 
 aActualizeProgress->Execute();
-mpGallery->ReleaseTheme( pTheme, maLocalListner );
+mpGallery->ReleaseTheme( pTheme, maLocalListener );
 }
 else if (rIdent == u"delete")
 {
@@ -376,7 +376,7 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 }
 else if (rIdent == u"rename")
 {
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
maLocalListner );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
maLocalListener );
 const OUString  aOldName( pTheme->GetName() );
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -399,11 +399,11 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 mpGallery->RenameTheme( aOldName, aName );
 }
 }
-mpGallery->ReleaseTheme( pTheme, maLocalListner );
+mpGallery->ReleaseTheme( pTheme, maLocalListener );
 }
 else if (rIdent == u"assign")
 {
-GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
maLocalListner );
+GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
maLocalListener );
 
 if (pTheme && !pTheme->IsReadOnly())
 {
@@ -414,7 +414,7 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 pTheme->SetId( aDlg->GetId(), true );
 }
 
-mpGallery->ReleaseTheme( pTheme, maLocalListner );
+mpGallery->ReleaseTheme( pTheme, maLocalListener );
 }
 else if (rIdent == u"properties")
 {
@@ -1497,7 +1497,7 @@ void GalleryBrowser1::FillThemeEntries()
 const GalleryThemeEntry* pThemeInfo = mpGallery->GetThemeInfo( i );
 OUString aThemeName = pThemeInfo->GetThemeName();
 //sal_uInt32 nId = pThemeInfo->GetId();
-if (GalleryTheme* pTheme = mpGallery->AcquireTheme(aThemeName, 
maLocalListner))
+if (GalleryTheme* pTheme = mpGallery->AcquireTheme(aThemeName, 
maLocalListener))
 {
 sal_uInt32 nObjectCount = pTheme->GetObjectCount();
 for (size_t 

core.git: svx/source

2024-09-07 Thread Xisco Fauli (via logerrit)
 svx/source/gallery2/galbrws1.cxx |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 3a0c79aace5b93b597d827485da87b10d0d6cecc
Author: Xisco Fauli 
AuthorDate: Sat Sep 7 17:59:26 2024 +0200
Commit: Caolán McNamara 
CommitDate: Sat Sep 7 21:14:59 2024 +0200

svx: fix Dereference before null check

Seen in 
https://crashreport.libreoffice.org/stats/signature/GalleryBrowser1::FillThemeEntries()

Regression from
commit 09c6204b6309321aa25c542f918fde9f5f3f7fe2
Author: Oliver Specht 
Date:   Thu Feb 29 17:15:23 2024 +0100

tdf#81880 Search the Gallery

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

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 4aeb69fbb2df..14d2e841e4e0 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -1497,17 +1497,19 @@ void GalleryBrowser1::FillThemeEntries()
 const GalleryThemeEntry* pThemeInfo = mpGallery->GetThemeInfo( i );
 OUString aThemeName = pThemeInfo->GetThemeName();
 //sal_uInt32 nId = pThemeInfo->GetId();
-GalleryTheme* pTheme = mpGallery->AcquireTheme(aThemeName, 
maLocalListner);
-sal_uInt32 nObjectCount = pTheme->GetObjectCount();
-for (size_t nObject = 0; nObject < nObjectCount; ++nObject)
+if (GalleryTheme* pTheme = mpGallery->AcquireTheme(aThemeName, 
maLocalListner))
 {
-if (std::unique_ptr xSgaObject = 
pTheme->AcquireObject(nObject))
+sal_uInt32 nObjectCount = pTheme->GetObjectCount();
+for (size_t nObject = 0; nObject < nObjectCount; ++nObject)
 {
-OUString aTitle = GetItemText(*xSgaObject, 
GalleryItemFlags::Title);
-maAllThemeEntries.push_back(ThemeEntry(aThemeName, aTitle, 
nObject));
+if (std::unique_ptr xSgaObject = 
pTheme->AcquireObject(nObject))
+{
+OUString aTitle = GetItemText(*xSgaObject, 
GalleryItemFlags::Title);
+maAllThemeEntries.push_back(ThemeEntry(aThemeName, 
aTitle, nObject));
+}
 }
+mpGallery->ReleaseTheme(pTheme, maLocalListner);
 }
-mpGallery->ReleaseTheme(pTheme, maLocalListner);
 }
 maFoundThemeEntries.assign(maAllThemeEntries.begin(), 
maAllThemeEntries.end());
 }


core.git: svx/source

2024-08-29 Thread Caolán McNamara (via logerrit)
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |   71 
 svx/source/sidebar/possize/PosSizePropertyPanel.hxx |6 +
 2 files changed, 65 insertions(+), 12 deletions(-)

New commits:
commit db92117fae3034dea59c8e589d93756406678427
Author: Caolán McNamara 
AuthorDate: Thu Aug 29 11:57:10 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 29 14:22:26 2024 +0200

Resolves: tdf#160675 reformat 'blanked' metricspinbutton after setting value

click on background, set_text sets a blank for the content of the metric
spin button, so explicitly reformat when a value is set afterwards.

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

diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx 
b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index def1f363b9f7..04844ff1fee2 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -119,6 +119,11 @@ PosSizePropertyPanel::PosSizePropertyPanel(
 mbAutoWidth(false),
 mbAutoHeight(false),
 mbAdjustEnabled(false),
+mbMtrPosXBlanked(false),
+mbMtrPosYBlanked(false),
+mbMtrWidthBlanked(false),
+mbMtrHeightBlanked(false),
+mbMtrAngleBlanked(false),
 mxSidebar(std::move(xSidebar))
 {
 Initialize();
@@ -539,11 +544,17 @@ void PosSizePropertyPanel::NotifyItemUpdate(
 limitWidth(*mxMtrWidth);
 mlOldWidth = lOldWidth1;
 mxMtrWidth->save_value();
+if (mbMtrWidthBlanked)
+{
+mxMtrWidth->reformat();
+mbMtrWidthBlanked = false;
+}
 break;
 }
 }
 
-mxMtrWidth->set_text( u""_ustr );
+mxMtrWidth->set_text(u""_ustr);
+mbMtrWidthBlanked = true;
 break;
 
 case SID_ATTR_TRANSFORM_HEIGHT:
@@ -559,6 +570,11 @@ void PosSizePropertyPanel::NotifyItemUpdate(
 limitWidth(*mxMtrHeight);
 mlOldHeight = nTmp;
 mxMtrHeight->save_value();
+if (mbMtrHeightBlanked)
+{
+mxMtrHeight->reformat();
+mbMtrHeightBlanked = false;
+}
 break;
 }
 }
@@ -578,11 +594,17 @@ void PosSizePropertyPanel::NotifyItemUpdate(
 SetMetricValue( *mxMtrPosX, nTmp, mePoolUnit );
 limitWidth(*mxMtrPosX);
 mxMtrPosX->save_value();
+if (mbMtrPosXBlanked)
+{
+mxMtrPosX->reformat();
+mbMtrPosXBlanked = false;
+}
 break;
 }
 }
 
-mxMtrPosX->set_text( u""_ustr );
+mxMtrPosX->set_text(u""_ustr);
+mbMtrPosXBlanked = true;
 break;
 
 case SID_ATTR_TRANSFORM_POS_Y:
@@ -597,11 +619,17 @@ void PosSizePropertyPanel::NotifyItemUpdate(
 SetMetricValue( *mxMtrPosY, nTmp, mePoolUnit );
 limitWidth(*mxMtrPosY);
 mxMtrPosY->save_value();
+if (mbMtrPosYBlanked)
+{
+mxMtrPosY->reformat();
+mbMtrPosYBlanked = false;
+}
 break;
 }
 }
 
-mxMtrPosY->set_text( u""_ustr );
+mxMtrPosY->set_text(u""_ustr);
+mbMtrPosYBlanked = true;
 break;
 
 case SID_ATTR_TRANSFORM_ROT_X:
@@ -698,11 +726,18 @@ void PosSizePropertyPanel::NotifyItemUpdate(
 mxMtrAngle->set_value(nTmp.get(), FieldUnit::DEGREE);
 mxCtrlDial->SetRotation(nTmp);
 
+if (mbMtrAngleBlanked)
+{
+mxMtrAngle->reformat();
+mbMtrAngleBlanked = false;
+}
+
 break;
 }
 }
 
-mxMtrAngle->set_text( u""_ustr );
+mxMtrAngle->set_text(u""_ustr);
+mbMtrAngleBlanked = true;
 mxCtrlDial->SetRotation( 0_deg100 );
 break;
 
@@ -898,28 +933,40 @@ void PosSizePropertyPanel::MetricState(SfxItemState 
eState, const SfxPoolItem* p
 if (mxMtrPosX->get_text().isEmpty())
 bPosXBlank = true;
 SetFieldUnit( *mxMtrPosX, meDlgUnit, true );
-if(bPosXBlank)
-mxMtrPosX->set_text(OUString());
+if (bPosXBlank)
+{
+mxMtrPosX->set_text(u""_ustr);
+mbMtrPosXBlanked = true;
+}
 
 if (mxMtrPosY->get_text().isEmpty())

core.git: svx/source

2024-08-27 Thread Heiko Tietze (via logerrit)
 svx/source/dialog/srchdlg.cxx   |7 +--
 svx/source/form/labelitemwindow.cxx |8 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 4702e9ecfc66dc0f624ec73670092fd3062ae327
Author: Heiko Tietze 
AuthorDate: Tue Aug 27 11:31:18 2024 +0200
Commit: Heiko Tietze 
CommitDate: Tue Aug 27 14:46:31 2024 +0200

Resolves tdf#162582 - Muted color for search info on dark themes

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

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 679cc66a2a41..ef32b558b50b 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -317,7 +317,6 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 m_xSearchTmplLB->make_sorted();
 m_xSearchAttrText->hide();
 
-m_xSearchLabel->set_font_color(Color(0x00, 0x47, 0x85));
 this->SetSearchLabel(u""_ustr); // hide the message but keep the box height
 m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - 
too large here
 
@@ -564,7 +563,11 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
 {
 m_xSearchLabel->show();
 m_xSearchIcon->show();
-m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
+const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+if (rStyleSettings.GetDialogColor().IsDark())
+m_xSearchBox->set_background(Color(0x00, 0x56, 0x80));
+else
+m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
 }
 else
 {
diff --git a/svx/source/form/labelitemwindow.cxx 
b/svx/source/form/labelitemwindow.cxx
index ca68e0c426fd..b364bd523ed8 100644
--- a/svx/source/form/labelitemwindow.cxx
+++ b/svx/source/form/labelitemwindow.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 
 LabelItemWindow::LabelItemWindow(vcl::Window* pParent, const OUString& rLabel)
 : InterimItemWindow(pParent, u"svx/ui/labelbox.ui"_ustr, u"LabelBox"_ustr)
@@ -47,8 +48,11 @@ void LabelItemWindow::set_label(const OUString& rLabel, 
const LabelItemWindowTyp
 else if (eType == LabelItemWindowType::Info)
 {
 m_xImage->show();
-m_xLabel->set_font_color(Color(0x00, 0x47, 0x85));
-m_xBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
+const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+if (rStyleSettings.GetDialogColor().IsDark())
+m_xBox->set_background(Color(0x00, 0x56, 0x80));
+else
+m_xBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
 }
 m_xLabel->set_visible(
 true); // always show and not just if !rLabel.isEmpty() to not make 
the chevron appear


core.git: svx/source

2024-08-25 Thread Mike Kaganski (via logerrit)
 svx/source/gallery2/galbrws1.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit ed0ef16bb01225ab4ab1c6fd5a4959f76d77b11d
Author: Mike Kaganski 
AuthorDate: Sun Aug 25 22:26:45 2024 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 26 06:22:46 2024 +0200

tdf#162593: blind crash fix

The stack trace was:

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x732175ee in rtl::OUString::OUString (this=0x7fffaac0, 
str=...) at /home/cono/git/lo/libreoffice/include/rtl/ustring.hxx:197
197 pData = str.pData;
#0  0x732175ee in rtl::OUString::OUString(rtl::OUString const&) 
(this=0x7fffaac0, str=...) at 
/home/cono/git/lo/libreoffice/include/rtl/ustring.hxx:197
#1  0x73521e4f in GalleryBrowser1::GetItemText(SgaObject const&, 
GalleryItemFlags) (rObj=..., nItemTextFlags=GalleryItemFlags::Title) at 
/home/cono/git/lo/libreoffice/svx/source/gallery2/galbrws1.cxx:1412
#2  0x7352265d in GalleryBrowser1::FillThemeEntries() 
(this=0x5c0c9240) at 
/home/cono/git/lo/libreoffice/svx/source/gallery2/galbrws1.cxx:1505
#3  0x7351a602 in GalleryBrowser1::GalleryBrowser1(weld::Builder&, 
Gallery*) (this=0x5c0c9240, rBuilder=..., pGallery=0x5c0a4aa0) at 
/home/cono/git/lo/libreoffice/svx/source/gallery2/galbrws1.cxx:196
#4  0x7354c291 in 
svx::sidebar::GalleryControl::GalleryControl(weld::Widget*) 
(this=0x5c04e470, pParent=0x5be85558) at 
/home/cono/git/lo/libreoffice/svx/source/gallery2/GalleryControl.cxx:32
#5  0x745c72ea in std::make_unique(weld::Widget*&) () at /usr/include/c++/12/bits/unique_ptr.h:1065
#6  0x745c5f7a in (anonymous 
namespace)::PanelFactory::createUIElement(rtl::OUString const&, 
com::sun::star::uno::Sequence const&) 
(this=0x5c0494e0, rsResourceURL=..., rArguments=...) at 
/home/cono/git/lo/libreoffice/svx/source/sidebar/PanelFactory.cxx:180
#7  0x76412417 in (anonymous 
namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, 
com::sun::star::uno::Sequence const&) 
(this=0x564db3e0, ResourceURL=..., Args=...) at 
/home/cono/git/lo/libreoffice/framework/source/uifactory/uielementfactorymanager.cxx:440
#8  0x75593a35 in 
sfx2::sidebar::SidebarController::CreateUIElement(com::sun::star::uno::Reference
 const&, rtl::OUString const&, bool, sfx2::sidebar::Context const&) 
(this=0x5b0a8100, rxWindow=..., rsImplementationURL=..., 
bWantsCanvas=false, rContext=...) at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:1044
#9  0x75593341 in 
sfx2::sidebar::SidebarController::CreatePanel(std::basic_string_view >, weld::Widget*, bool, sfx2::sidebar::Context 
const&, VclPtr const&) (this=0x5b0a8100, 
rsPanelId=u"GalleryPanel", pParentWindow=0x5c040718, 
bIsInitiallyExpanded=true, rContext=..., pDeck=...) at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:989
#10 0x75592150 in 
sfx2::sidebar::SidebarController::CreatePanels(std::basic_string_view >, sfx2::sidebar::Context const&) 
(this=0x5b0a8100, rDeckId=u"GalleryDeck", rContext=...) at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:789
#11 0x75591dbe in 
sfx2::sidebar::SidebarController::CreateDeck(std::basic_string_view >, sfx2::sidebar::Context const&, bool) 
(this=0x5b0a8100, rDeckId=u"GalleryDeck", rContext=..., bForceCreate=false) 
at /home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:737
#12 0x75592b96 in 
sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor 
const&, sfx2::sidebar::Context const&) (this=0x5b0a8100, 
rDeckDescriptor=..., rContext=...) at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:899
#13 0x75591b89 in 
sfx2::sidebar::SidebarController::SwitchToDeck(std::basic_string_view >) (this=0x5b0a8100, rsDeckId=u"GalleryDeck") at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:708
#14 0x75591936 in 
sfx2::sidebar::SidebarController::OpenThenToggleDeck(rtl::OUString const&) 
(this=0x5b0a8100, rsDeckId=...) at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:664
#15 0x7558d884 in operator()(rtl::OUString const&) const 
(__closure=0x7fffb7c0, rsDeckId=...) at 
/home/cono/git/lo/libreoffice/sfx2/source/sidebar/SidebarController.cxx:123
#16 0x75598e13 in std::__invoke_impl&, const 
rtl::OUString&>(std::__invoke_other, struct {...} &) (__f=...) at 
/usr/include/c++/12/bits/invoke.h:61
#17 0x7559851c in std::__invoke_r&, const 
rtl::OUString&>(struct {...} &) (__fn=...) at 
/usr/include/c++/12/bits/invoke.h:111
#18 0x75597b76 in std::_Function_handler >::_M_invoke(const 
std::_Any_data &, const rtl::OUString &) (__functor=..., __args#0=...) at 
/us

core.git: svx/source

2024-08-22 Thread Mike Kaganski (via logerrit)
 svx/source/unogallery/unogaltheme.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 0afb4cfc5ed1e926dfd287007c5a35585584daec
Author: Mike Kaganski 
AuthorDate: Thu Aug 22 11:08:42 2024 +0200
Commit: Mike Kaganski 
CommitDate: Thu Aug 22 14:24:13 2024 +0200

tdf#162555: change rtl::Reference creation order

GalleryDrawingModel takes ownership of passed model; so when it
gets destroyed, the model is destroyed, too. Destroying SdrPage
tries to set the model modified.

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

diff --git a/svx/source/unogallery/unogaltheme.cxx 
b/svx/source/unogallery/unogaltheme.cxx
index 27f2afd3b360..de016a7b61e4 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -255,11 +255,13 @@ void SAL_CALL GalleryTheme::update(  )
 if (pOrigPage && pOrigModel)
 {
 FmFormModel* pTmpModel = new 
FmFormModel(&pOrigModel->GetItemPool());
+// tdf#162555: xDrawing should be created before pNewPage, 
because it controls
+// the lifetime of pTmpModel used by the latter
+rtl::Reference< GalleryDrawingModel > xDrawing( new 
GalleryDrawingModel( pTmpModel ) );
 // Clone to new target SdrModel
 rtl::Reference pNewPage = 
pOrigPage->CloneSdrPage(*pTmpModel);
 pTmpModel->InsertPage(pNewPage.get(), 0);
 
-rtl::Reference< GalleryDrawingModel > xDrawing( new 
GalleryDrawingModel( pTmpModel ) );
 pTmpModel->setUnoModel( xDrawing );
 
 nRet = insertDrawingByIndex( xDrawing, nIndex );


core.git: svx/source

2024-08-20 Thread Mike Kaganski (via logerrit)
 svx/source/unodraw/UnoGraphicExporter.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 20b16048236598880dc94bac146079426ae8f309
Author: Mike Kaganski 
AuthorDate: Tue Aug 20 15:01:02 2024 +0500
Commit: Mike Kaganski 
CommitDate: Tue Aug 20 16:21:54 2024 +0200

tdf#162528: handle exceptions from JSON parser in GraphicExporter

Similar to commit 218695f947dfecaa92209adf0c5572b99f0c021f "tdf#150846:
FilterOptions in descriptor could come from import filter", 2022-09-21

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

diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index 72ae293ee4e2..0ea662b61a1c 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -388,9 +389,16 @@ void GraphicExporter::ParseSettings(const 
Sequence& rDescriptor,
 if (!aFilterData.hasElements() && !aFilterOptions.isEmpty())
 {
 // Allow setting filter data keys from the cmdline.
-std::vector aData
-= comphelper::JsonToPropertyValues(aFilterOptions.toUtf8());
-aFilterData = comphelper::containerToSequence(aData);
+try
+{
+std::vector aData
+= 
comphelper::JsonToPropertyValues(aFilterOptions.toUtf8());
+aFilterData = comphelper::containerToSequence(aData);
+}
+catch (const boost::property_tree::json_parser::json_parser_error&)
+{
+// This wasn't a valid json; maybe came from import filter 
(tdf#162528)
+}
 if (aFilterData.hasElements())
 {
 aMap[u"FilterData"_ustr] <<= aFilterData;


core.git: svx/source

2024-08-14 Thread Julien Nabet (via logerrit)
 svx/source/tbxctrls/Palette.cxx |  109 +---
 1 file changed, 102 insertions(+), 7 deletions(-)

New commits:
commit 53730cc3b0a6b0228f680962f79ae6bec9e7fe02
Author: Julien Nabet 
AuthorDate: Sun Aug 11 16:34:13 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Aug 14 13:38:30 2024 +0200

Related tdf#135561: read ase palette with Lab colormodel

I took example on colorConversions.js from avisek, see
https://gist.github.com/avisek/eadfbe7a7a169b1001a2d3affc21052e

2 steps: convert Lab to XYZ, then XYZ to RGB

credit Avisek Das and István Ujj-Mészáros

Change-Id: I3a80259b6de1aca7fe3c308d9024e9b9f2a5a425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171729
Reviewed-by: Michael Meeks 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx
index 8f78c0c2bc45..29158cbfcac8 100644
--- a/svx/source/tbxctrls/Palette.cxx
+++ b/svx/source/tbxctrls/Palette.cxx
@@ -78,6 +78,102 @@ static void lcl_CMYKtoRGB( float fCyan, float fMagenta, 
float fYellow, float fKe
 dB = std::clamp( 1.0 - fYellow, 0.0, 1.0 );
 }
 
+// This function based on code under ALv2 - Copyright 2013 István Ujj-Mészáros
+// credit Avisek Das and István Ujj-Mészáros
+static void lcl_XYZtoRGB( float fX, float fY, float fZ, float& dR, float& dG, 
float& dB)
+{
+// Observer = 2°, Illuminant = D65
+fX = fX / 100;
+fY = fY / 100;
+fZ = fZ / 100;
+
+// X from 0 to 95.047
+dR = fX * 3.2406 + fY * -1.5372 + fZ * -0.4986;
+// Y from 0 to 100.000
+dG = fX * -0.9689 + fY * 1.8758 + fZ * 0.0415;
+// Z from 0 to 108.883
+dB = fX * 0.0557 + fY * -0.2040 + fZ * 1.0570;
+
+if (dR > 0.0031308)
+{
+dR = 1.055 * (std::pow(dR, 0.4167)) - 0.055;
+}
+else
+{
+dR = 12.92 * dR;
+}
+
+if (dG > 0.0031308)
+{
+dG = 1.055 * (std::pow(dG, 0.4167)) - 0.055;
+}
+else
+{
+dG = 12.92 * dG;
+}
+
+if (dB > 0.0031308)
+{
+dB = 1.055 * (std::pow(dB, 0.4167)) - 0.055;
+}
+else
+{
+dB = 12.92 * dB;
+}
+dR *= 255;
+dG *= 255;
+dB *= 255;
+}
+
+// This function based on code under ALv2 - Copyright 2013 István Ujj-Mészáros
+// credit Avisek Das and István Ujj-Mészáros
+static void lcl_LABtoXYZ( float fL, float fa, float fb, float& dX, float& dY, 
float& dZ)
+{
+dY = (fL + 16) / 116;
+dX = (fa / 500) + dY;
+dZ = dY - (fb / 200);
+
+if (std::pow(dY, 3) > 0.008856)
+{
+dY = std::pow(dY, 3);
+}
+else
+{
+dY = (dY - 0.137931034) /  7.787;
+}
+
+if (std::pow(dX, 3) > 0.008856)
+{
+dX = std::pow(dX, 3);
+}
+else
+{
+dX = (dX - 0.137931034) /  7.787;
+}
+
+if (std::pow(dZ, 3) > 0.008856)
+{
+dZ = std::pow(dZ, 3);
+}
+else
+{
+dZ = (dZ - 0.137931034) /  7.787;
+}
+
+// Observer = 2°, Illuminant = D65
+dX = 95.047 * dX;
+dY = 100.000 * dY;
+dZ = 108.883 * dZ;
+}
+
+static void lcl_LABtoRGB( float fL, float fa, float fb, float& dR, float& dG, 
float& dB)
+{
+float x, y, z;
+lcl_LABtoXYZ(fL, fa, fb, x, y, z);
+
+lcl_XYZtoRGB(x, y, z, dR, dG, dB);
+}
+
 void PaletteASE::LoadPalette()
 {
 SvFileStream aFile(maFPath, StreamMode::READ);
@@ -153,14 +249,13 @@ void PaletteASE::LoadPalette()
 aFile.ReadFloat(nVal);
 r = g = b = nVal;
 }
-else
+else if (aColorModel.equalsIgnoreAsciiCase("LAB "))
 {
-float nL = 0, nA = 0, nB = 0;
-aFile.ReadFloat(nL);
-aFile.ReadFloat(nA);
-aFile.ReadFloat(nB);
-// TODO: How to convert LAB to RGB?
-r = g = b = 0;
+float fL = 0, fA = 0, fB = 0;
+aFile.ReadFloat(fL);
+aFile.ReadFloat(fA);
+aFile.ReadFloat(fB);
+lcl_LABtoRGB(fL, fA, fB, r, g, b);
 }
 
 // Ignore color type


core.git: svx/source

2024-08-04 Thread Mike Kaganski (via logerrit)
 svx/source/dialog/cuicharmap.cxx |   39 ++-
 1 file changed, 22 insertions(+), 17 deletions(-)

New commits:
commit 2bb84e874bd17afcf3e417d2e4fc32aaafe841c3
Author: Mike Kaganski 
AuthorDate: Sun Aug 4 14:38:01 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sun Aug 4 14:52:09 2024 +0200

tdf#111816: allow special characters filtering by Unicode value

When the Search box starts with U+ (or u+),  the rest will be treated
as beginning of a Unicode value in hexadecimal notation (ignoring any
leading zeroes). E.g., "U+12" would match U+0120 and U+12F90, but not
U+0112. "u+012" will match exactly the same codepoints.

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

diff --git a/svx/source/dialog/cuicharmap.cxx b/svx/source/dialog/cuicharmap.cxx
index 2ff8fea652e4..84195ccd5543 100644
--- a/svx/source/dialog/cuicharmap.cxx
+++ b/svx/source/dialog/cuicharmap.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -483,35 +484,39 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchUpdateHdl, 
weld::Entry&, void)
 if (!m_xSearchText->get_text().isEmpty())
 {
 m_xSearchSet->ClearPreviousData();
-OUString aKeyword = m_xSearchText->get_text();
+OUString aKeyword = 
m_xSearchText->get_text().trim().toAsciiLowerCase();
+OUString hex_code;
+if (std::u16string_view rest; aKeyword.startsWith("u+", &rest))
+if (auto n = o3tl::toInt32(rest, 16))
+hex_code = OUString::number(n, 16); // this removes leading 
zeroes
 
 toggleSearchView(true);
 
 FontCharMapRef xFontCharMap = m_xSearchSet->GetFontCharMap();
 
-sal_UCS4 sChar = xFontCharMap->GetFirstChar();
-while(sChar != xFontCharMap->GetLastChar())
+for (sal_UCS4 ucs4 = xFontCharMap->GetFirstChar();; ucs4 = 
xFontCharMap->GetNextChar(ucs4))
 {
+bool bAdded = false;
 UErrorCode errorCode = U_ZERO_ERROR;
 char buffer[100];
-u_charName(sChar, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), 
&errorCode);
+u_charName(ucs4, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), 
&errorCode);
 if (U_SUCCESS(errorCode))
 {
 OUString sName = OUString::createFromAscii(buffer);
-if(!sName.isEmpty() && 
sName.toAsciiLowerCase().indexOf(aKeyword.toAsciiLowerCase()) >= 0)
-m_xSearchSet->AppendCharToList(sChar);
+if (!sName.isEmpty() && 
sName.toAsciiLowerCase().indexOf(aKeyword) >= 0)
+{
+m_xSearchSet->AppendCharToList(ucs4);
+bAdded = true;
+}
 }
-sChar = xFontCharMap->GetNextChar(sChar);
-}
-//for last char
-UErrorCode errorCode = U_ZERO_ERROR;
-char buffer[100];
-u_charName(sChar, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), 
&errorCode);
-if (U_SUCCESS(errorCode))
-{
-OUString sName = OUString::createFromAscii(buffer);
-if(!sName.isEmpty() && 
sName.toAsciiLowerCase().indexOf(aKeyword.toAsciiLowerCase()) >= 0)
-m_xSearchSet->AppendCharToList(sChar);
+if (!bAdded && !hex_code.isEmpty())
+{
+OUString actual_number = OUString::number(ucs4, 16);
+if (actual_number.startsWith(hex_code))
+m_xSearchSet->AppendCharToList(ucs4);
+}
+if (ucs4 == xFontCharMap->GetLastChar())
+break;
 }
 
 m_xSearchSet->UpdateScrollRange();


core.git: svx/source

2024-08-03 Thread Mike Kaganski (via logerrit)
 svx/source/dialog/searchcharmap.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 055c906d7b3f2e3709292d1410358d4e66a500ed
Author: Mike Kaganski 
AuthorDate: Sun Aug 4 00:00:36 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sat Aug 3 22:44:24 2024 +0200

tdf#123527: use the new font in SvxSearchCharSet::RecalculateFont

Taking the font from the render context makes no sense, when the
intention is to set the new font set in SvxShowCharSet::SetFont.
Basically, it now does a similar thing as in overridden parent's
SvxShowCharSet::RecalculateFont.

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

diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index c1c289d6366d..16acbc61e985 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -170,7 +170,7 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& 
rRenderContext)
 
 Size aSize(GetOutputSizePixel());
 
-vcl::Font aFont = rRenderContext.GetFont();
+vcl::Font aFont = maFont;
 aFont.SetWeight(WEIGHT_LIGHT);
 aFont.SetAlignment(ALIGN_TOP);
 int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT);


core.git: svx/source sw/qa

2024-08-01 Thread Mike Kaganski (via logerrit)
 svx/source/xoutdev/_xoutbmp.cxx|9 +++--
 sw/qa/extras/htmlexport/data/tdf162282.odt |binary
 sw/qa/extras/htmlexport/htmlexport.cxx |   44 +
 3 files changed, 49 insertions(+), 4 deletions(-)

New commits:
commit 7a1a0607501e47ff03b1b66e1189a221d327bad4
Author: Mike Kaganski 
AuthorDate: Thu Aug 1 18:21:00 2024 +0500
Commit: Mike Kaganski 
CommitDate: Thu Aug 1 20:33:52 2024 +0200

tdf#162282: restore correct handling of EMF

Commit 166a16594eb4e7e78f3f5b00a1432637d109bf8d (Simplify logic in
XOutBitmap::WriteGraphic a bit, 2023-04-01) changed the logic, so
that when the graphic's data reported VectorGraphicDataType::Wmf
type, it wasn't further checked if its link's IsEMF returns true.
That made isKnownVectorFormat return false for such EMFs, and so
the graphic was exported to a new EMF, instead of using its data.
This restores the original behavior.

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

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index f3923e378a1e..1c7ecadb34cf 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -127,6 +127,10 @@ static OUString isKnownVectorFormat(const Graphic& 
rGraphic, std::u16string_view
 if (!pData || pData->getBinaryDataContainer().getSize() == 0)
 return {};
 
+if (FORMAT_EMF.equalsIgnoreAsciiCase(rFilter)
+&& (pData->getType() == VectorGraphicDataType::Emf || 
rGraphic.GetGfxLink().IsEMF()))
+return FORMAT_EMF;
+
 // Does the filter name match the original format?
 switch (pData->getType())
 {
@@ -135,14 +139,11 @@ static OUString isKnownVectorFormat(const Graphic& 
rGraphic, std::u16string_view
 case VectorGraphicDataType::Wmf:
 return match(rFilter, FORMAT_WMF, false);
 case VectorGraphicDataType::Emf:
-return match(rFilter, FORMAT_EMF, false);
+break;
 case VectorGraphicDataType::Pdf:
 return match(rFilter, FORMAT_PDF, false);
 }
 
-if (rGraphic.GetGfxLink().IsEMF())
-return match(rFilter, FORMAT_EMF, false);
-
 return {};
 }
 
diff --git a/sw/qa/extras/htmlexport/data/tdf162282.odt 
b/sw/qa/extras/htmlexport/data/tdf162282.odt
new file mode 100644
index ..b67fd119bc28
Binary files /dev/null and b/sw/qa/extras/htmlexport/data/tdf162282.odt differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index e510d7d2e7ab..5de5ef5f155f 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -3388,6 +3388,50 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testHTML_exportRelativeURLs)
 CPPUNIT_ASSERT(url.endsWith(".gif"));
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_162282)
+{
+// Given a document with an embedded metafile:
+createSwDoc("tdf162282.odt");
+ExportToReqif();
+xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
+
+// Check that the exported EMF is exactly the same as in the ODF package
+assertXPath(pDoc, "//reqif-xhtml:p/reqif-xhtml:object"_ostr, "type"_ostr, 
u"image/x-emf"_ustr);
+OUString imgName = getXPath(pDoc, 
"//reqif-xhtml:p/reqif-xhtml:object"_ostr, "data"_ostr);
+CPPUNIT_ASSERT(imgName.endsWith(".emf"));
+INetURLObject aUrl(maTempFile.GetURL());
+aUrl.setName(imgName);
+SvFileStream 
aEmfStream(aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE),
+StreamMode::READ);
+
+// without the fix, this would fail with
+// - Expected: 220
+// - Actual  : 111260
+CPPUNIT_ASSERT_EQUAL(sal_uInt64(220), aEmfStream.TellEnd());
+
+css::uno::Sequence emfData(220);
+aEmfStream.ReadBytes(emfData.getArray(), emfData.getLength());
+
+const css::uno::Sequence correctData{
+0x01, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00,
+0x00, 0xF4, 0x01, 0x00, 0x00, 0xF4, 0x01, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x88, 0x13, 0x00, 0x00, 0x88, 0x13, 0x00, 0x00, 0x20, 
0x45, 0x4D, 0x46, 0x00,
+0x00, 0x01, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 
0x03, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x80, 0x07, 0x00,
+0x00, 0x38, 0x04, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x6C, 0x00, 
0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 
0x01, 0x00, 0x00, 0xF4,
+0x01, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 
0x02, 0x00, 0x00, 0x00,
+0x2D, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 
0x00, 0x96, 0x00, 0x00,
+0x00, 0xFA, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x14, 0x00, 
0x00, 0x00,

core.git: svx/source

2024-07-29 Thread Noel Grandin (via logerrit)
 svx/source/sdr/properties/textproperties.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit ac41bc3c908c815cf9725b6316d0537d43401ddb
Author: Noel Grandin 
AuthorDate: Sat Jul 27 12:51:47 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 29 10:25:17 2024 +0200

tdf#161846 remove one layout operations (ii)

of the 6 we perform per caption object

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

diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index 38aa230832ab..c1e7a2f6e0c6 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -354,10 +354,8 @@ namespace sdr::properties
 }
 }
 
-if(rObj.IsTextFrame())
-{
+if(rObj.IsTextFrame() && 
!rObj.getSdrModelFromSdrObject().isLocked())
 rObj.NbcAdjustTextFrameWidthAndHeight();
-}
 }
 
 void TextProperties::ForceDefaultAttributes()


core.git: svx/source

2024-07-20 Thread Caolán McNamara (via logerrit)
 svx/source/customshapes/EnhancedCustomShape2d.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 0eb68857daef5b0fcda8bfe501d3f0a683590a1f
Author: Caolán McNamara 
AuthorDate: Sat Jul 20 14:56:55 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sat Jul 20 17:53:46 2024 +0200

ofz#70412 Integer-overflow

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

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index bc640da6af2d..f42d90cfd3fb 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -559,8 +559,12 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const 
SdrCustomShapeGeometryIt
 {
 m_nCoordLeft= aViewBox.X;
 m_nCoordTop = aViewBox.Y;
-m_nCoordWidthG  = std::abs( aViewBox.Width );
-m_nCoordHeightG = std::abs( aViewBox.Height);
+m_nCoordWidthG  = aViewBox.Width;
+if (m_nCoordWidthG < 0)
+m_nCoordWidthG = o3tl::saturating_toggle_sign(m_nCoordWidthG);
+m_nCoordHeightG = aViewBox.Height;
+if (m_nCoordHeightG < 0)
+m_nCoordHeightG = o3tl::saturating_toggle_sign(m_nCoordHeightG);
 }
 static constexpr OUString sPath( u"Path"_ustr );
 static constexpr OUStringLiteral sCoordinates( u"Coordinates" );


core.git: svx/source

2024-07-19 Thread Andrea Gelmini (via logerrit)
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5915280c4193ba6a129ddb4f7ad911f106873ffa
Author: Andrea Gelmini 
AuthorDate: Fri Jul 19 13:10:03 2024 +0200
Commit: Andrea Gelmini 
CommitDate: Fri Jul 19 17:14:07 2024 +0200

Fix typo

Change-Id: I005cbaafeb3f630bd5e5713181aa1ea64ae22ee7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170757
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index b9652f72f8f9..d4ce74d1c025 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -404,7 +404,7 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 if(!rFillGradient.isDefault())
 {
 // SDPR: check early if we have a gradient and an alpha
-// gradient that 'fits' in it's geometric definition
+// gradient that 'fits' in its geometric definition
 // so that it can be rendered as RGBA directly. If yes,
 // create it and return early
 const bool bIncludeAlpha(


core.git: svx/source

2024-07-19 Thread Andrea Gelmini (via logerrit)
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 188218fbe8ea412c371e94b7cfe69669a1b93d11
Author: Andrea Gelmini 
AuthorDate: Fri Jul 19 13:09:52 2024 +0200
Commit: Andrea Gelmini 
CommitDate: Fri Jul 19 16:33:00 2024 +0200

Fix typo

Change-Id: I7a2a583f7646a6d881fecc47ba4cf9158d6d8dcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170756
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 56656722d287..b9652f72f8f9 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -403,7 +403,7 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 
 if(!rFillGradient.isDefault())
 {
-// SDPR: check early if we have a radient and a alpha
+// SDPR: check early if we have a gradient and an alpha
 // gradient that 'fits' in it's geometric definition
 // so that it can be rendered as RGBA directly. If yes,
 // create it and return early


core.git: svx/source

2024-07-18 Thread Andrea Gelmini (via logerrit)
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5cc3e2fa66b0e0320c1a961594c68ea5338bbfbc
Author: Andrea Gelmini 
AuthorDate: Tue Jul 16 14:15:27 2024 +0200
Commit: Andrea Gelmini 
CommitDate: Thu Jul 18 19:18:00 2024 +0200

Fix typo

Change-Id: Ia6ea67804f637cf89db9569a47fbaf7cca4049ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170576
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index cd3588270162..79bc74bf28a5 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -406,7 +406,7 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 && rFillGradient.sameDefinitionThanAlpha(rAlphaGradient))
 {
 // if yes, create a primitive expressing that. That primitive's
-// decomnpose will do the same as if the code below would be 
executed,
+// decompose will do the same as if the code below would be 
executed,
 // so no primitive renderer who does not want to will have to 
handle
 // it - but SDPR renderers that can directly render that may 
choose to
 // do so. NOTE: That helper primitive just holds references to 
what


core.git: svx/source

2024-07-13 Thread Mike Kaganski (via logerrit)
 svx/source/xoutdev/_xoutbmp.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit b5907f1d6e06bf6c28a06c87cfc4de7b7e96b454
Author: Mike Kaganski 
AuthorDate: Sat Jul 13 19:13:08 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sat Jul 13 18:16:22 2024 +0200

Simplify a bit

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

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index f722dc394530..f3923e378a1e 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -275,7 +275,6 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 if( GRFILTER_FORMAT_NOTFOUND != nFilter )
 {
 Graphic aGraphic;
-OUString aExt = rFilter.GetExportFormatShortName( nFilter 
).toAsciiLowerCase();
 
 if (bAnimated)
 aGraphic = rGraphic;
@@ -344,7 +343,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 if (aGraphic.GetType() != GraphicType::NONE)
 {
 if( !(nFlags & XOutFlags::DontAddExtension) )
-aURL.setExtension( aExt );
+
aURL.setExtension(rFilter.GetExportFormatShortName(nFilter).toAsciiLowerCase());
 rFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE 
);
 if (pMediaType)
 *pMediaType = rFilter.GetExportFormatMediaType(nFilter);


core.git: svx/source

2024-07-12 Thread Vladislav Tarakanov (via logerrit)
 svx/source/unodraw/unoshap4.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit fe897b36aef28dfe175461c43614e22588fcfd84
Author: Vladislav Tarakanov 
AuthorDate: Fri Jul 12 04:22:21 2024 +0400
Commit: Mike Kaganski 
CommitDate: Fri Jul 12 14:02:42 2024 +0200

tdf#158510 Launch media from a presentation dir path

Added a check for the existence of a file at a given URL.
If the specified file could not be found, the path formed from the
directory containing the presentation file and the file name is used.

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

diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 19cb3c318986..5f25660c0d3f 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -822,6 +823,17 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& 
rName, const SfxItemPr
 if( rValue >>= aURL )
 {
 bOk = true;
+if ( aURL.startsWith("file:///") && 
!comphelper::DirectoryHelper::fileExists(aURL) )
+{
+comphelper::IEmbeddedHelper* pPersist = 
GetSdrObject()->getSdrModelFromSdrObject().GetPersist();
+auto fileDirectoryEndIdx = 
pPersist->getDocumentBaseURL().lastIndexOf("/");
+auto fileNameStartIdx = aURL.lastIndexOf("/");
+if (fileDirectoryEndIdx != -1 && fileNameStartIdx != -1)
+{
+aURL = 
OUString::Concat(pPersist->getDocumentBaseURL().subView(0, fileDirectoryEndIdx 
+ 1))
++ aURL.subView(fileNameStartIdx + 1);
+}
+}
 aItem.setURL( aURL, u""_ustr, referer_ );
 }
 }


core.git: svx/source sw/qa

2024-07-10 Thread Mike Kaganski (via logerrit)
 svx/source/inc/UnoGraphicExporter.hxx|9 
 svx/source/unodraw/UnoGraphicExporter.cxx|   69 +++---
 svx/source/unodraw/tableshape.cxx|2 
 svx/source/xoutdev/_xoutbmp.cxx  |   85 
 sw/qa/extras/htmlexport/data/tdf161979_metafile.fodt |  200 +++
 sw/qa/extras/htmlexport/htmlexport.cxx   |   48 
 6 files changed, 334 insertions(+), 79 deletions(-)

New commits:
commit 37217909f2e7c042eab9a8b5eb1ab0a88cdda513
Author: Mike Kaganski 
AuthorDate: Wed Jul 10 12:26:37 2024 +0500
Commit: Mike Kaganski 
CommitDate: Wed Jul 10 22:20:00 2024 +0200

tdf#161979: Render GDI metafile using drawinglayer in XOutBitmap

After the changes related to EMF+ reworking,  much of the code was removed
from VCL, e.g. commit 217ad59a412ebab07a106b14c8976d20bddb9356 (tdf#111486
Removed not used EMF+ code, 2018-12-07).  EMF+ code is now in drawinglayer
(see EmfPlusHelperData::processEmfPlusData).  Unfortunately, we can't make
ImpGraphic::draw in VCL to use drawinglayer for rendering,  because VCL is
lower in dependency tree (it only can use drawinglayercore).

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

diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx 
b/svx/source/inc/UnoGraphicExporter.hxx
similarity index 87%
rename from svx/source/unodraw/UnoGraphicExporter.hxx
rename to svx/source/inc/UnoGraphicExporter.hxx
index ace0db252919..65014c4d7290 100644
--- a/svx/source/unodraw/UnoGraphicExporter.hxx
+++ b/svx/source/inc/UnoGraphicExporter.hxx
@@ -17,17 +17,18 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX
-#define INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX
+#pragma once
 
 #include 
 
+#include 
 #include 
 
+class Size;
+class GDIMetaFile;
 class SdrObject;
 
+BitmapEx GetBitmapFromMetaFile(const GDIMetaFile& rMtf, const Size* pSize);
 Graphic SvxGetGraphicForShape(SdrObject& rShape);
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index 451b95b0e58b..72ae293ee4e2 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -66,7 +66,7 @@
 #include 
 #include 
 #include 
-#include "UnoGraphicExporter.hxx"
+#include 
 #include 
 // #i102251#
 #include 
@@ -171,37 +171,6 @@ namespace {
 SdrModel*   mpDoc;
 };
 
-/** creates a bitmap that is optionally transparent from a metafile
-*/
-BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, const Size* pSize 
)
-{
-// use new primitive conversion tooling
-basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0));
-sal_uInt32 nMaximumQuadraticPixels(50);
-
-if(pSize)
-{
-// use 100th mm for primitive bitmap converter tool, input is pixel
-// use a real OutDev to get the correct DPI, the static 
LogicToLogic assumes 72dpi which is wrong (!)
-const Size 
aSize100th(Application::GetDefaultDevice()->PixelToLogic(*pSize, 
MapMode(MapUnit::Map100thMM)));
-
-aRange.expand(basegfx::B2DPoint(aSize100th.Width(), 
aSize100th.Height()));
-
-// when explicitly pixels are requested from the GraphicExporter, 
use a *very* high limit
-// of 16gb (4096x4096 pixels), else use the default for the 
converters
-nMaximumQuadraticPixels = std::min(sal_uInt32(4096 * 4096), 
sal_uInt32(pSize->Width() * pSize->Height()));
-}
-else
-{
-// use 100th mm for primitive bitmap converter tool
-const Size 
aSize100th(OutputDevice::LogicToLogic(rMtf.GetPrefSize(), 
rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)));
-
-aRange.expand(basegfx::B2DPoint(aSize100th.Width(), 
aSize100th.Height()));
-}
-
-return convertMetafileToBitmapEx(rMtf, aRange, 
nMaximumQuadraticPixels);
-}
-
 Size* CalcSize( sal_Int32 nWidth, sal_Int32 nHeight, const Size& 
aBoundSize, Size& aOutSize )
 {
 if( (nWidth == 0) && (nHeight == 0) )
@@ -1289,6 +1258,42 @@ Sequence< OUString > SAL_CALL 
GraphicExporter::getSupportedMimeTypeNames(  )
 
 }
 
+/** creates a bitmap that is optionally transparent from a metafile
+*/
+BitmapEx GetBitmapFromMetaFile(const GDIMetaFile& rMtf, const Size* pSize)
+{
+// use new primitive conversion tooling
+basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0));
+sal_uInt32 nMaximumQuadraticPixels;
+
+if (pSize)
+{
+// use 100th mm for primitive bitmap converter tool, input is pixel
+// use a real OutDev to get the correct DPI, the static LogicToLogic 
assumes 72dpi which is wrong (!)
+

core.git: svx/source

2024-07-10 Thread Jim Raykowski (via logerrit)
 svx/source/dialog/ctredlin.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit d9856b2ca5f3e80c978bd34330648b6345765202
Author: Jim Raykowski 
AuthorDate: Fri Jul 5 11:15:35 2024 -0800
Commit: Jim Raykowski 
CommitDate: Wed Jul 10 17:38:09 2024 +0200

tdf#161811 related: Fix change manager dialog context popup menu

Sort By > Document Position results

With out the patch installed gtk sorts by the Action column. x11 and qt
also do something other than expected.

Change-Id: Ic36e79cf928e5ba142b7ff435999e806b1d56214
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170059
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 504cbe0f5256..49091e01578a 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -90,7 +90,12 @@ SvxRedlinTable::~SvxRedlinTable()
 
 IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void)
 {
-if (!bSorted)
+if (nColumn == -1)
+{
+pTreeView->make_unsorted();
+bSorted = false;
+}
+else if (!bSorted)
 {
 pTreeView->make_sorted();
 bSorted = true;
@@ -99,7 +104,7 @@ IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void)
 bool bSortAtoZ = pTreeView->get_sort_order();
 
 //set new arrow positions in headerbar
-if (nColumn == pTreeView->get_sort_column())
+if (nColumn != -1 && nColumn == pTreeView->get_sort_column())
 {
 bSortAtoZ = !bSortAtoZ;
 pTreeView->set_sort_order(bSortAtoZ);


core.git: svx/source svx/uiconfig

2024-06-21 Thread Jim Raykowski (via logerrit)
 svx/source/form/filtnav.cxx|2 +-
 svx/uiconfig/ui/filternavigator.ui |   13 +
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit c5bbbe987321d8f9e101fab9d67ddbf3d4f8dfca
Author: Jim Raykowski 
AuthorDate: Thu Jun 20 17:04:11 2024 -0800
Commit: Jim Raykowski 
CommitDate: Fri Jun 21 18:29:40 2024 +0200

tdf#161537 fix Filter Navigator no longer shows the name of the field

Change-Id: I3dae3458ac5795b217743b1e6897345a22f1bf61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169310
Reviewed-by: Jim Raykowski 
Tested-by: Jenkins

diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 722deefaca35..fe633e9fdd20 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1061,7 +1061,7 @@ FmFilterNavigator::FmFilterNavigator(vcl::Window* 
pTopLevel, std::unique_ptrconnect_custom_get_size(LINK(this, FmFilterNavigator, 
CustomGetSizeHdl));
 m_xTreeView->connect_custom_render(LINK(this, FmFilterNavigator, 
CustomRenderHdl));
-m_xTreeView->set_column_custom_renderer(0, true);
+m_xTreeView->set_column_custom_renderer(1, true);
 
 m_xTreeView->connect_changed(LINK(this, FmFilterNavigator, SelectHdl));
 m_xTreeView->connect_key_press(LINK(this, FmFilterNavigator, KeyInputHdl));
diff --git a/svx/uiconfig/ui/filternavigator.ui 
b/svx/uiconfig/ui/filternavigator.ui
index 46820867f42e..8999be58f37b 100644
--- a/svx/uiconfig/ui/filternavigator.ui
+++ b/svx/uiconfig/ui/filternavigator.ui
@@ -4,7 +4,7 @@
   
   
 
-  
+  
   
   
   
@@ -43,16 +43,21 @@
   
 
 
-  
+  
+False
+  
+
+
+  
 6
 
-  
+  
   
 0
   
 
 
-  
+  
 True
   
   


core.git: svx/source

2024-06-19 Thread Tomaž Vajngerl (via logerrit)
 svx/source/dialog/svxruler.cxx |   72 +
 1 file changed, 65 insertions(+), 7 deletions(-)

New commits:
commit 908334f85ee9ecd1d7aa4825e25c48a59516f804
Author: Tomaž Vajngerl 
AuthorDate: Fri May 31 15:01:36 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 20 04:53:35 2024 +0200

svx: adjust the values for impress/draw ruler to work with LOKit

The values in impress/draw don't need to be converted to 100th mm
as the vales are already in 100th mm.

However the null offset and page size needs to be adjusted,
because in impress/draw the actual document doesn't start at 0,0
but there is one document width or 1/2 document height margin to
the left, right, up and down of the document. So the null offset
returns the number of the document width or 1/2 document height.
For LOKit the null offset needs to be subtracted.

Similar needs to be done for page width and height. The page width
is docuemnt width * 3 and page height is document height * 2. So to
get expected numbers for LOKit, the page width needs to be divided
by 3 and page height divided by 2.

Change-Id: I8d5561d5273b4bbeab475565504fa64c7f882fd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168276
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 54d8c1b8f2934d6196a8b19400879fb6b67c255b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168986
Tested-by: Jenkins

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index e0b84b9ad1ba..3f447bf9a1af 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -50,8 +50,13 @@
 #include 
 #include 
 #include "rlrcitem.hxx"
+#include 
+#include 
+#include 
 #include 
 
+using namespace css;
+
 #define CTRL_ITEM_COUNT 14
 #define GAP 10
 #define OBJECT_BORDER_COUNT 4
@@ -193,7 +198,6 @@ SvxRuler::SvxRuler(
 bActive(true),
 mbCoarseSnapping(false),
 mbSnapping(true)
-
 {
 /* Constructor; Initialize data buffer; controller items are created */
 
@@ -279,7 +283,6 @@ SvxRuler::SvxRuler(
 ruler_tab_svx.DPIScaleFactor = pParent->GetDPIScaleFactor();
 ruler_tab_svx.height *= ruler_tab_svx.DPIScaleFactor;
 ruler_tab_svx.width  *= ruler_tab_svx.DPIScaleFactor;
-
 }
 
 SvxRuler::~SvxRuler()
@@ -1147,12 +1150,67 @@ void SvxRuler::SetNullOffsetLogic(tools::Long lVal) // 
Setting of the logic Null
 
 void SvxRuler::CreateJsonNotification(tools::JsonWriter& rJsonWriter)
 {
-rJsonWriter.put("margin1", convertTwipToMm100(GetMargin1()));
-rJsonWriter.put("margin2", convertTwipToMm100(GetMargin2()));
-rJsonWriter.put("leftOffset", convertTwipToMm100(GetNullOffset()));
-rJsonWriter.put("pageOffset", convertTwipToMm100(GetPageOffset()));
+tools::Long nMargin1 = 0;
+tools::Long nMargin2 = 0;
+tools::Long nNullOffset = 0;
+tools::Long nPageOffset = 0;
+tools::Long nPageWidthHeight = 0;
+
+bool bWriter = false;
+
+// Determine if we are a Ruler for Writer or not
+if (SfxViewFrame* pFrame = SfxViewFrame::Current())
+{
+uno::Reference xFrame = 
pFrame->GetFrame().GetFrameInterface();
+uno::Reference xModel = 
xFrame->getController()->getModel();
+uno::Reference xSI(xModel, uno::UNO_QUERY);
+if (xSI.is())
+{
+bWriter = xSI->supportsService("com.sun.star.text.TextDocument")
+|| xSI->supportsService("com.sun.star.text.WebDocument")
+|| xSI->supportsService("com.sun.star.text.GlobalDocument");
+}
+}
+
+if (bWriter)
+{
+// In Writer the ruler values need to be converted first from pixel to 
twips (default logical unit) and then to 100thmm
+nMargin1 = convertTwipToMm100(ConvertPosLogic(GetMargin1()));
+nMargin2 = convertTwipToMm100(ConvertPosLogic(GetMargin2()));
+nNullOffset = convertTwipToMm100(ConvertPosLogic(GetNullOffset()));
+nPageOffset = convertTwipToMm100(ConvertPosLogic(GetPageOffset()));
+nPageWidthHeight = convertTwipToMm100(GetPageWidth());
+}
+else
+{
+// Only convert from pixel to default logical unit, which is 100thmm 
for Impress
+nMargin1 = ConvertPosLogic(GetMargin1());
+nMargin2 = ConvertPosLogic(GetMargin2());
+nPageOffset = ConvertPosLogic(GetPageOffset());
+
+// In LOKit API we expect the ruler 0,0 coordinate is where the 
document starts.
+// In Impress and Draw the ruler 0,0 is where the canvas starts, not 
where the document starts.
+// The margin to the document is 1 document width (on the left and 
right) and 0.5 document height
+// (on the top and bottom).
+// So the canvas width = 3 * document width, canvas height = 2 * 
document height
+if (isHorizontal())
+{
+nPageWidthHeight = GetPageWidth() / 3;
+   

core.git: svx/source

2024-06-19 Thread Andrea Gelmini (via logerrit)
 svx/source/unodraw/unoshap4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29c32b59d5c0d91d28ba5086ee253fa39a784440
Author: Andrea Gelmini 
AuthorDate: Wed Jun 19 15:21:32 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 19 22:57:22 2024 +0200

Fix typo

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

diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 58ad9a6b2db0..19cb3c318986 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -297,7 +297,7 @@ bool SvxOle2Shape::getPropertyValueImpl( const OUString& 
rName, const SfxItemPro
 if ( xObj.is()
   && ( pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT || 
pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT || 
svt::EmbeddedObjectRef::TryRunningState( xObj ) ) )
 {
-// Discussed with CL fue to the before GetPaintingPageView
+// Discussed with CL due to the before GetPaintingPageView
 // usage. Removed it, former fallback is used now
 if ( pProperty->nWID == OWN_ATTR_OLEMODEL || pProperty->nWID 
== OWN_ATTR_OLE_EMBEDDED_OBJECT )
 {


core.git: svx/source

2024-06-19 Thread Andrea Gelmini (via logerrit)
 svx/source/svdraw/textchainflow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 796863113f8c981ed93cfa22ee45878d8429ed85
Author: Andrea Gelmini 
AuthorDate: Wed Jun 19 21:51:20 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 19 22:55:26 2024 +0200

Fix typo

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

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 343048a9a4b5..b7dc65cf7106 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -105,7 +105,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 if (!bOldUpdateMode) // Reset only if the old value was false
 pFlowOutl->SetUpdateLayout(bOldUpdateMode);
 
-// NOTE: Must be called after mp*ChText abd b*flow have been set but 
before mbOFisUFinduced is reset
+// NOTE: Must be called after mp*ChText and b*flow have been set but 
before mbOFisUFinduced is reset
 impUpdateCursorInfo();
 
 // To check whether an overflow is underflow induced or not (useful in 
cursor checking)


core.git: svx/source

2024-06-19 Thread Andrea Gelmini (via logerrit)
 svx/source/svdraw/textchainflow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eb08a328843409acc1e0350a8b440b080de4bb2d
Author: Andrea Gelmini 
AuthorDate: Wed Jun 19 21:52:35 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 19 22:52:40 2024 +0200

Fix typo

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

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 9763ea5015cb..343048a9a4b5 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -148,7 +148,7 @@ bool TextChainFlow::IsUnderflow() const
 }
 
 
-// XXX: In editing mode you need to get "underflowing" text from editing 
outliner, so it's kinda separate from the drawing one!
+// XXX: In editing mode you need to get "underflowing" text from editing 
outliner, so it's kinda separated from the drawing one!
 
 // XXX:Would it be possible to unify underflow and its possibly following 
overflow?
 void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)


core.git: svx/source

2024-06-18 Thread Andrea Gelmini (via logerrit)
 svx/source/unodraw/UnoGraphicExporter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 602e00b9610cdacc078846bb845c306df65b29dc
Author: Andrea Gelmini 
AuthorDate: Wed Jun 19 00:04:38 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 19 08:43:05 2024 +0200

Fix typo

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

diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index 679bed4e4051..451b95b0e58b 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -886,7 +886,7 @@ bool GraphicExporter::GetGraphic( ExportSettings const & 
rSettings, Graphic& aGr
 
 // calculate bound rect for all shapes
 // tdf#126319 I did not convert all rendering to primitives,
-// that would be to much for this fix. But I  did so for the
+// that would be too much for this fix. But I  did so for the
 // range calculation to get a valid high quality range.
 // Based on that the conversion is reliable. With the BoundRect
 // fetched from the Metafile it was just not possible to get the


core.git: svx/source

2024-06-18 Thread Andrea Gelmini (via logerrit)
 svx/source/unodraw/UnoGraphicExporter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 59cfd8f4f69bd5918cb704b0a38b73ea2c9831bf
Author: Andrea Gelmini 
AuthorDate: Tue Jun 18 22:47:23 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 19 08:38:34 2024 +0200

Fix typo

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

diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index 3f980f4e9763..679bed4e4051 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -885,7 +885,7 @@ bool GraphicExporter::GetGraphic( ExportSettings const & 
rSettings, Graphic& aGr
 ScopedVclPtrInstance< VirtualDevice > aOut;
 
 // calculate bound rect for all shapes
-// tdf#126319 I did not convert all rendering to primities,
+// tdf#126319 I did not convert all rendering to primitives,
 // that would be to much for this fix. But I  did so for the
 // range calculation to get a valid high quality range.
 // Based on that the conversion is reliable. With the BoundRect


core.git: svx/source

2024-06-14 Thread Mike Kaganski (via logerrit)
 svx/source/table/tablehtmlimporter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d474b972ce63407d2a91b56808d6df37164b9cef
Author: Mike Kaganski 
AuthorDate: Fri Jun 14 23:48:27 2024 +0500
Commit: Aron Budea 
CommitDate: Sat Jun 15 00:11:38 2024 +0200

Fix MSVC build

 C:/BuildLO/core/svx/source/table/tablehtmlimporter.cxx(500): error C2220: 
the following warning is treated as an error
 C:\BuildLO
Change-Id: I2af1635a714cba3d27eb6b8b25db9b4c4aeaaade
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168894
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/svx/source/table/tablehtmlimporter.cxx 
b/svx/source/table/tablehtmlimporter.cxx
index 12b6a84ad94b..645851820ebd 100644
--- a/svx/source/table/tablehtmlimporter.cxx
+++ b/svx/source/table/tablehtmlimporter.cxx
@@ -441,7 +441,7 @@ void SdrTableHTMLParser::ProcToken(HtmlImportInfo* pInfo)
 case HtmlTokenId::TABLEDATA_ON:
 {
 ++mnCellInRow;
-DBG_ASSERT(mpActDefault, "TABLEDATA_OFF: pActDefault==0");
+assert(mpActDefault);
 RowColSpan aRowColSpan = lcl_GetRowColSpan(options);
 mpActDefault->mnColSpan = aRowColSpan.mnColSpan;
 mpActDefault->mnRowSpan = aRowColSpan.mnRowSpan;


core.git: svx/source

2024-06-11 Thread Rafael Lima (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |   33 +---
 1 file changed, 16 insertions(+), 17 deletions(-)

New commits:
commit 81f73ee5128eaa6328a2b08b0398202d747312ca
Author: Rafael Lima 
AuthorDate: Tue Jun 11 01:04:30 2024 +0200
Commit: Rafael Lima 
CommitDate: Tue Jun 11 20:13:01 2024 +0200

tdf#161204 Fix selection outline with overlapping ranges

The previous commit [1] caused a regression in the outline when two or more 
ranges overlapped in the selection. This patch fixes the issue.

[1] dc243f0122ba656d2630e93bebfb84a2bfe4042a

Change-Id: Ib5ec72504ba0efaae715c47628c3d5a47557f506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168618
Reviewed-by: Rafael Lima 
Tested-by: Jenkins

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 232d6dcc487b..700aa1915c75 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -40,12 +40,19 @@ namespace sdr::overlay
 // combine ranges geometrically to a single, ORed polygon
 static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const 
std::vector< basegfx::B2DRange >& rRanges)
 {
+// Determines the offset in twips
+Size aSize(1, 1);
+aSize = o3tl::convert(aSize, o3tl::Length::px, o3tl::Length::twip);
+const sal_Int32 nOffset = aSize.getWidth();
+
 const sal_uInt32 nCount(rRanges.size());
 basegfx::B2DPolyPolygon aRetval;
 
 for(sal_uInt32 a(0); a < nCount; a++)
 {
-const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(rRanges[a]));
+basegfx::B2DRange aRange(rRanges[a]);
+aRange.grow(nOffset);
+const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(aRange));
 
 if(0 == a)
 {
@@ -60,23 +67,15 @@ namespace sdr::overlay
 return aRetval;
 }
 
-// Creates an ORed polygon with all the ranges shrinked by 1px
-// This is used to draw the internal white line in the selection
-static basegfx::B2DPolyPolygon 
impCombineRangesToInternalPolyPolygon(const std::vector< basegfx::B2DRange >& 
rRanges)
+// tdf#161204 Creates a poly-polygon using white hairline to provide 
contrast
+static basegfx::B2DPolyPolygon 
impCombineRangesToContrastPolyPolygon(const std::vector< basegfx::B2DRange >& 
rRanges)
 {
-// Determines the offset in twips
-Size aSize(1, 1);
-aSize = o3tl::convert(aSize, o3tl::Length::px, o3tl::Length::twip);
-const sal_Int32 nShrink = aSize.getWidth();
-
 const sal_uInt32 nCount(rRanges.size());
 basegfx::B2DPolyPolygon aRetval;
 
 for(sal_uInt32 a(0); a < nCount; a++)
 {
-basegfx::B2DRange aRange(rRanges[a]);
-aRange.grow(-nShrink);
-const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(aRange));
+const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(rRanges[a]));
 
 if(0 == a)
 {
@@ -175,16 +174,16 @@ namespace sdr::overlay
 std::move(aPolyPolygon),
 aRGBColor));
 
-// Internal outline with white color to provide 
contrast
-basegfx::B2DPolyPolygon 
aInternalPolyPolygon(impCombineRangesToInternalPolyPolygon(getRanges()));
-const drawinglayer::primitive2d::Primitive2DReference 
aInternalSelectionOutline(
+// tdf#161204 Outline with white color to provide 
contrast
+basegfx::B2DPolyPolygon 
aContrastPolyPolygon(impCombineRangesToContrastPolyPolygon(getRanges()));
+const drawinglayer::primitive2d::Primitive2DReference 
aContrastSelectionOutline(
 new 
drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
-std::move(aInternalPolyPolygon),
+std::move(aContrastPolyPolygon),
 basegfx::BColor(1.0, 1.0, 1.0)));
 
 // add both to result
 aRetval = 
drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparence, 
aSelectionOutline };
-
aRetval.append(drawinglayer::primitive2d::Primitive2DContainer{aUnifiedTransparence,
 aInternalSelectionOutline});
+
aRetval.append(drawinglayer::primitive2d::Primitive2DContainer{aUnifiedTransparence,
 aContrastSelectionOutline});
 }
 else
 {


core.git: svx/source

2024-06-10 Thread Andrea Gelmini (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2254c416261c8001f002067c306c13b32adab5fa
Author: Andrea Gelmini 
AuthorDate: Mon Jun 10 21:42:29 2024 +0200
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Tue Jun 11 01:40:14 2024 +0200

Fix typo

Change-Id: I65fa0676119a2e52e23acddc564143cd1e519df1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168647
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 963546145b46..232d6dcc487b 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -60,7 +60,7 @@ namespace sdr::overlay
 return aRetval;
 }
 
-// Creates an ORed polygon with all the ranges shriked by 1px
+// Creates an ORed polygon with all the ranges shrinked by 1px
 // This is used to draw the internal white line in the selection
 static basegfx::B2DPolyPolygon 
impCombineRangesToInternalPolyPolygon(const std::vector< basegfx::B2DRange >& 
rRanges)
 {


core.git: svx/source

2024-06-10 Thread Rafael Lima (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |   40 
 1 file changed, 40 insertions(+)

New commits:
commit dc243f0122ba656d2630e93bebfb84a2bfe4042a
Author: Rafael Lima 
AuthorDate: Sat Jun 8 00:32:10 2024 +0200
Commit: Rafael Lima 
CommitDate: Mon Jun 10 19:20:30 2024 +0200

tdf#161204 Improve visibility of outline in the selection overlay

As discussed in the design meeting, this patch adds an internal white 
outline to the selection overlay to provide better contrast.

FTR: This is the same approach used by other office suites (Excel, 
OnlyOffice, etc).

Change-Id: I9b279ebfa9efbd2b5d9894b94ebda653c3dba6e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168538
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins
Reviewed-by: Rafael Lima 

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index ba1d90d7092a..963546145b46 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -60,6 +60,37 @@ namespace sdr::overlay
 return aRetval;
 }
 
+// Creates an ORed polygon with all the ranges shriked by 1px
+// This is used to draw the internal white line in the selection
+static basegfx::B2DPolyPolygon 
impCombineRangesToInternalPolyPolygon(const std::vector< basegfx::B2DRange >& 
rRanges)
+{
+// Determines the offset in twips
+Size aSize(1, 1);
+aSize = o3tl::convert(aSize, o3tl::Length::px, o3tl::Length::twip);
+const sal_Int32 nShrink = aSize.getWidth();
+
+const sal_uInt32 nCount(rRanges.size());
+basegfx::B2DPolyPolygon aRetval;
+
+for(sal_uInt32 a(0); a < nCount; a++)
+{
+basegfx::B2DRange aRange(rRanges[a]);
+aRange.grow(-nShrink);
+const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(aRange));
+
+if(0 == a)
+{
+aRetval.append(aDiscretePolygon);
+}
+else
+{
+aRetval = basegfx::utils::solvePolygonOperationOr(aRetval, 
basegfx::B2DPolyPolygon(aDiscretePolygon));
+}
+}
+
+return aRetval;
+}
+
 // check if wanted type OverlayType::Transparent or OverlayType::Solid
 // is possible. If not, fallback to invert mode (classic mode)
 static OverlayType impCheckPossibleOverlayType(OverlayType 
aOverlayType)
@@ -137,14 +168,23 @@ namespace sdr::overlay
 
 if(mbBorder)
 {
+// External outline using themed color
 basegfx::B2DPolyPolygon 
aPolyPolygon(impCombineRangesToPolyPolygon(getRanges()));
 const drawinglayer::primitive2d::Primitive2DReference 
aSelectionOutline(
 new 
drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
 std::move(aPolyPolygon),
 aRGBColor));
 
+// Internal outline with white color to provide 
contrast
+basegfx::B2DPolyPolygon 
aInternalPolyPolygon(impCombineRangesToInternalPolyPolygon(getRanges()));
+const drawinglayer::primitive2d::Primitive2DReference 
aInternalSelectionOutline(
+new 
drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+std::move(aInternalPolyPolygon),
+basegfx::BColor(1.0, 1.0, 1.0)));
+
 // add both to result
 aRetval = 
drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparence, 
aSelectionOutline };
+
aRetval.append(drawinglayer::primitive2d::Primitive2DContainer{aUnifiedTransparence,
 aInternalSelectionOutline});
 }
 else
 {


core.git: svx/source

2024-06-03 Thread Caolán McNamara (via logerrit)
 svx/source/fmcomp/gridctrl.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 6f2b5043613bea755f01b413fd86ece0b3a29e5d
Author: Caolán McNamara 
AuthorDate: Mon Jun 3 17:22:21 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 3 22:43:45 2024 +0200

crashtesting: BrowseBox::GetControlArea crash

see with forums/ods/forum-en-11050.ods

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

diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index faedec67aa66..b6fb24d05df7 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -817,11 +817,15 @@ void DbGridControl::dispose()
 
 m_aBar.disposeAndClear();
 
+m_aRearrangeIdle.Stop();
+
 EditBrowseBox::dispose();
 }
 
 void DbGridControl::RearrangeAtIdle()
 {
+if (isDisposed())
+return;
 m_aRearrangeIdle.Start();
 }
 
@@ -2642,6 +2646,9 @@ IMPL_LINK_NOARG(DbGridControl, OnDelete, void*, void)
 
 IMPL_LINK_NOARG(DbGridControl, RearrangeHdl, Timer*, void)
 {
+if (isDisposed())
+return;
+
 // and give it a chance to rearrange
 Point aPoint = GetControlArea().TopLeft();
 sal_uInt16 nX = static_cast(aPoint.X());


core.git: svx/source

2024-06-01 Thread Andrea Gelmini (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c1868ec03260efd5d90db733ed5e9927f04d8961
Author: Andrea Gelmini 
AuthorDate: Sat Jun 1 12:13:26 2024 +0200
Commit: Julien Nabet 
CommitDate: Sat Jun 1 13:51:06 2024 +0200

Fix typo

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

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 49418ae906e9..ba1d90d7092a 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -37,7 +37,7 @@
 namespace sdr::overlay
 {
 
-// combine rages geometrically to a single, ORed polygon
+// combine ranges geometrically to a single, ORed polygon
 static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const 
std::vector< basegfx::B2DRange >& rRanges)
 {
 const sal_uInt32 nCount(rRanges.size());


core.git: svx/source

2024-06-01 Thread Noel Grandin (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |  233 +++-
 1 file changed, 60 insertions(+), 173 deletions(-)

New commits:
commit 302a221856809e2b046cb9fb1675bfff4d86a37d
Author: Noel Grandin 
AuthorDate: Thu May 30 13:31:28 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Jun 1 10:22:55 2024 +0200

tdf#161198 tdf#161322 fix selection overlays

revert
commit 7b1405689d4246e0e37e8759f03e1962af964cec
Author: Noel Grandin 
Date:   Fri Apr 19 22:56:04 2024 +0200
reduce the number of drawing primitives we create in
OverlaySelection

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

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index a5598c1d2125..49418ae906e9 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -34,137 +34,31 @@
 #include 
 #include 
 
-namespace
-{
-struct B2DPointCompare
-{
-bool operator()(const basegfx::B2DPoint& lhs, const basegfx::B2DPoint& 
rhs) const
-{
-return std::make_pair(lhs.getX(), lhs.getY()) < 
std::make_pair(rhs.getX(), rhs.getY());
-}
-};
-
-struct B2DPointCompareYThenX
-{
-bool operator()(const basegfx::B2DPoint& lhs, const basegfx::B2DPoint& 
rhs) const
-{
-return std::make_pair(lhs.getY(), lhs.getX()) < 
std::make_pair(rhs.getY(), rhs.getX());
-}
-};
-
-}
-
 namespace sdr::overlay
 {
 
-// Combine rectangles geometrically to a single OR'ed polygon.
-// Algorithm is from
-// "Uniqueness of orthogonal connect-the-dots" Joseph O'Rourke 1988
-// The basic algorithm is:
-//   Sort points by lowest x, lowest y
-//   Go through each column and create edges between the vertices 2i and 
2i + 1 in that column
-//   Sort points by lowest y, lowest x
-//   Go through each row and create edges between the vertices 2i and 2i + 
1 in that row.
-//
-static basegfx::B2DPolyPolygon impCombineRectanglesToPolyPolygon(const 
std::vector< basegfx::B2DRange >& rRectangles)
-{
-o3tl::sorted_vector sort_x;
-for (auto const & rRect : rRectangles)
+// combine rages geometrically to a single, ORed polygon
+static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const 
std::vector< basegfx::B2DRange >& rRanges)
 {
-auto checkPoint = [&sort_x](double x, double y)
-{
-basegfx::B2DPoint pt(x, y);
-auto it = sort_x.find(pt);
-if (it != sort_x.end()) // Shared vertice, remove it.
-sort_x.erase(it);
-else
-sort_x.insert(pt);
-};
-checkPoint(rRect.getMinX(), rRect.getMinY());
-checkPoint(rRect.getMinX(), rRect.getMaxY());
-checkPoint(rRect.getMaxX(), rRect.getMinY());
-checkPoint(rRect.getMaxX(), rRect.getMaxY());
-}
-
-
-o3tl::sorted_vector sort_y;
-for (auto const & i : sort_x)
-sort_y.insert(i);
-
-std::map 
edges_h;
-std::map 
edges_v;
+const sal_uInt32 nCount(rRanges.size());
+basegfx::B2DPolyPolygon aRetval;
 
-size_t i = 0;
-while (i < sort_x.size())
-{
-auto curr_y = sort_y[i].getY();
-while (i < sort_x.size() && sort_y[i].getY() == curr_y)
-{
-edges_h[sort_y[i]] = sort_y[i + 1];
-edges_h[sort_y[i + 1]] = sort_y[i];
-i += 2;
-}
-}
-i = 0;
-while (i < sort_x.size())
-{
-auto curr_x = sort_x[i].getX();
-while (i < sort_x.size() && sort_x[i].getX() == curr_x)
+for(sal_uInt32 a(0); a < nCount; a++)
 {
-edges_v[sort_x[i]] = sort_x[i + 1];
-edges_v[sort_x[i + 1]] = sort_x[i];
-i += 2;
-}
-}
+const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(rRanges[a]));
 
-// Get all the polygons.
-basegfx::B2DPolyPolygon aPolyPolygon;
-std::vector> tmpPolygon;
-while (!edges_h.empty())
-{
-tmpPolygon.clear();
-// We can start with any point.
-basegfx::B2DPoint pt = edges_h.begin()->first;
-edges_h.erase(edges_h.begin());
-tmpPolygon.push_back({pt, false});
-for (;;)
-{
-auto [curr, e] = tmpPolygon.back();
-if (!e)
+if(0 == a)
 {
-auto it = edges_v.find(curr);
-auto next_vertex = it->second;
-edges_v.erase(it);
-tmpPolygon.push_back({next

core.git: svx/source

2024-05-31 Thread Mike Kaganski (via logerrit)
 svx/source/sdr/properties/pageproperties.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit be2638603b85974cc452e3d453f4adb9d9f5d97f
Author: Mike Kaganski 
AuthorDate: Fri May 31 11:58:53 2024 +0500
Commit: Mike Kaganski 
CommitDate: Fri May 31 10:57:30 2024 +0200

tdf#161354: drop incorrect assertion

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

diff --git a/svx/source/sdr/properties/pageproperties.cxx 
b/svx/source/sdr/properties/pageproperties.cxx
index 011ab2192d70..79129497efdd 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -99,7 +99,7 @@ namespace sdr::properties
 
 void PageProperties::SetObjectItemSet(const SfxItemSet& /*rSet*/)
 {
-assert(!"PageProperties::SetObjectItemSet() should never be 
called");
+// This can be called e.g. when positioning the slide using dialog 
in Notes view
 }
 } // end of namespace
 


core.git: svx/source

2024-05-26 Thread Mike Kaganski (via logerrit)
 svx/source/svdraw/svdmrkv.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 741ab3c45335869f866f5616d97d5420fb41be77
Author: Mike Kaganski 
AuthorDate: Sun May 26 14:45:41 2024 +0200
Commit: Mike Kaganski 
CommitDate: Sun May 26 17:28:35 2024 +0200

Use Rectangle::expand instead of four Adjust* calls

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index c4c9f139f841..29885cf1aa1e 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -2398,10 +2398,7 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const 
Point& rPnt, sal_uInt16 nT
 nTol2*=2;
 }
 
-aRect.AdjustLeft( -nTol2 ); // add 1 tolerance for all objects
-aRect.AdjustTop( -nTol2 );
-aRect.AdjustRight(nTol2 );
-aRect.AdjustBottom(nTol2 );
+aRect.expand(nTol2); // add 1 tolerance for all objects
 
 if (aRect.Contains(rPnt))
 {


core.git: svx/source sw/qa

2024-05-22 Thread Mike Kaganski (via logerrit)
 svx/source/svdraw/svdopath.cxx |   11 +++
 sw/qa/extras/ooxmlexport/data/cloud.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport21.cxx |8 
 3 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 08da27fc377f443d1d6698f4a061fa462849062d
Author: Mike Kaganski 
AuthorDate: Wed May 22 20:22:08 2024 +0500
Commit: Mike Kaganski 
CommitDate: Wed May 22 20:53:05 2024 +0200

Handle empty range correctly

Otherwise, the translation gets MAX_DBL value, and scaling becomes 0.
After commit 690526f95e3ee4fd25bb2c987e093543e4bc435b (Generalize 
basegfx::fround
for templated return type, 2024-04-15) this made some documents (e.g., 
bugdoc
in tdf#85132) fail an assertion in debug builds, which allowed to find and 
fix
this problem.

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

diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 322b7444960f..935397d1ea61 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2850,11 +2850,14 @@ bool 
SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
 // itself, else this method will no longer return the full 
polygon information (curve will
 // be lost)
 const basegfx::B2DRange 
aPolyRangeNoCurve(basegfx::utils::getRange(rPolyPolygon));
-aScale = aPolyRangeNoCurve.getRange();
-aTranslate = aPolyRangeNoCurve.getMinimum();
+if (!aPolyRangeNoCurve.isEmpty())
+{
+aScale = aPolyRangeNoCurve.getRange();
+aTranslate = aPolyRangeNoCurve.getMinimum();
 
-// define matrix for move polygon to zero point
-aMoveToZeroMatrix.translate(-aTranslate.getX(), 
-aTranslate.getY());
+// define matrix for move polygon to zero point
+aMoveToZeroMatrix.translate(-aTranslate.getX(), 
-aTranslate.getY());
+}
 }
 }
 
diff --git a/sw/qa/extras/ooxmlexport/data/cloud.docx 
b/sw/qa/extras/ooxmlexport/data/cloud.docx
new file mode 100644
index ..74c4ac91031c
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/cloud.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index 6cfbe8d783fc..1c55be3df2cf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -553,6 +553,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf154369, "tdf154369.docx")
 "color"_ostr, "00527d55");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testEmptyObjectRange)
+{
+// Before the fix, this failed an assertion like this:
+// Assertion failed: isBetween(n, (SAL_MIN_INT64 + d / 2) / m, 
(SAL_MAX_INT64 - d / 2) / m),
+// file C:\lo+loadAndSave("cloud.docx");
+}
+
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 


core.git: svx/source

2024-05-14 Thread Noel Grandin (via logerrit)
 svx/source/dialog/framelinkarray.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 6f8a73a379d97829080367b21d54f9b5fab781c9
Author: Noel Grandin 
AuthorDate: Tue May 14 09:08:16 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue May 14 18:46:48 2024 +0200

tdf#161019 tdf#159846 spreadsheet border rendering

regression from
commit e27d4cc31e04be4c47b5085dfa2363ee45457e8a
Author: Noel Grandin 
Date:   Mon Jun 19 12:23:55 2023 +0200
tdf#150534 reduce the memory consumption of cells when calculating

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

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index cada4ee2f882..fbdc727ebf10 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -935,7 +935,7 @@ void Array::SetAddMergedLeftSize( sal_Int32 nCol, sal_Int32 
nRow, sal_Int32 nAdd
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddLeft = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 
@@ -950,7 +950,7 @@ void Array::SetAddMergedRightSize( sal_Int32 nCol, 
sal_Int32 nRow, sal_Int32 nAd
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddRight = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 
@@ -965,7 +965,7 @@ void Array::SetAddMergedTopSize( sal_Int32 nCol, sal_Int32 
nRow, sal_Int32 nAddS
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddTop = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 
@@ -980,7 +980,7 @@ void Array::SetAddMergedBottomSize( sal_Int32 nCol, 
sal_Int32 nRow, sal_Int32 nA
 return;
 Cell aTempCell(*pTempCell);
 aTempCell.mnAddBottom = nAddSize;
-mxImpl->PutCell( nCol, nRow, aTempCell );
+mxImpl->PutCell( aIt.Col(), aIt.Row(), aTempCell );
 }
 }
 


core.git: svx/source

2024-05-12 Thread Noel Grandin (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx |  424 +++
 1 file changed, 212 insertions(+), 212 deletions(-)

New commits:
commit 744dfe387bc7512cd028b1de43b956bd0974377c
Author: Noel Grandin 
AuthorDate: Wed May 8 21:24:11 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun May 12 09:24:10 2024 +0200

replace createFromAscii with OUString literals in 
EnhancedCustomShapeTypeNames

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx 
b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
index fe1db10f67c3..a6fcb11a60c1 100644
--- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
@@ -304,223 +304,223 @@ namespace {
 
 struct ACCNameTypeTable
 {
-const char* pS;
-const char* pE;
+OUString pS;
+OUString pE;
 };
 
 }
 
-const ACCNameTypeTable pACCNameTypeTableArray[] =
+constexpr ACCNameTypeTable pACCNameTypeTableArray[]
 {
-{ "non-primitive", "Non Primitive Shape" },
-{ "rectangle", "Rectangle" },
-{ "round-rectangle", "Rounded Rectangle" },
-{ "ellipse", "Ellipse" },
-{ "diamond", "Diamond" },
-{ "isosceles-triangle", "Triangle" },
-{ "right-triangle", "Right Triangle" },
-{ "parallelogram", "Parallelogram" },
-{ "trapezoid", "Trapezoid" },
-{ "hexagon", "Hexagon" },
-{ "octagon", "Octagon" },
-{ "cross", "Cross" },
-{ "star5", "5-Point Star" },
-{ "right-arrow", "Right Arrow" },
-//{ "mso-spt14", mso_sptThickArrow },
-{ "pentagon-right", "Pentagon" },
-{ "cube", "Cuboid" },
-{ "mso-spt21", "Doorplate" },
-/*{ "mso-spt17", mso_sptBalloon },
-{ "mso-spt18", mso_sptSeal },
-{ "mso-spt19", mso_sptArc },
-{ "mso-spt20", mso_sptLine },
-{ "mso-spt21", mso_sptPlaque },
-{ "can", mso_sptCan },*/
-{ "ring", "Ring" },
-/*{ "mso-spt24", mso_sptTextSimple },
-{ "mso-spt25", mso_sptTextOctagon },
-{ "mso-spt26", mso_sptTextHexagon },
-{ "mso-spt27", mso_sptTextCurve },
-{ "mso-spt28", mso_sptTextWave },
-{ "mso-spt29", mso_sptTextRing },
-{ "mso-spt30", mso_sptTextOnCurve },
-{ "mso-spt31", mso_sptTextOnRing },
-{ "mso-spt32", mso_sptStraightConnector1 },
-{ "mso-spt33", mso_sptBentConnector2 },
-{ "mso-spt34", mso_sptBentConnector3 },
-{ "mso-spt35", mso_sptBentConnector4 },
-{ "mso-spt36", mso_sptBentConnector5 },
-{ "mso-spt37", mso_sptCurvedConnector2 },
-{ "mso-spt38", mso_sptCurvedConnector3 },
-{ "mso-spt39", mso_sptCurvedConnector4 },
-{ "mso-spt40", mso_sptCurvedConnector5 },
-{ "mso-spt41", mso_sptCallout1 },
-{ "mso-spt42", mso_sptCallout2 },
-{ "mso-spt43", mso_sptCallout3 },
-{ "mso-spt44", mso_sptAccentCallout1 },
-{ "mso-spt45", mso_sptAccentCallout2 },
-{ "mso-spt46", mso_sptAccentCallout3 },*/
-{ "line-callout-1", "Line Callout 1" },
-{ "line-callout-2", "Line Callout 2" },
-/*{ "mso-spt49", mso_sptBorderCallout3 },
-{ "mso-spt50", mso_sptAccentBorderCallout1 },
-{ "mso-spt51", mso_sptAccentBorderCallout2 },
-{ "mso-spt52", mso_sptAccentBorderCallout3 },
-{ "mso-spt53", mso_sptRibbon },
-{ "mso-spt54", mso_sptRibbon2 },*/
-{ "chevron", "Chevron" },
-{ "pentagon", "Pentagon" },
-{ "forbidden", "'No' Symbol" },
-{ "star8", "8-Point Star" },
-/*{ "mso-spt59", mso_sptSeal16 },
-{ "mso-spt60", mso_sptSeal32 },*/
-{ "rectangular-callout", "Rectangular Callout" },
-{ "round-rectangular-callout", "Rounded Rectangular Callout" },
-{ "round-callout", "Round Callout" },
-//{ "mso-spt64", mso_sptWave },
-{ "paper", "Folded Corner" },
-{ "left-arrow", "Left Arrow" },
-{ "down-arrow", "Down Arrow" },
-{ "up-arrow", "Up Arrow" },
-{ "left-right-arrow", "Left and Right Arrow" },
-{ "up-down-arrow", "Up and Down Arrow" },
-//{ "mso-spt71", mso_sptIrregularSeal1 },
-{ "bang", "Explosion" },
-{ "lightning", "Lighting Bolt" },
-{ "heart", "Heart" },
-//{ "mso-spt75", mso_sptPictureFrame },
-{ "quad-arrow", "4-Way Arrow" },
-{ "left-arrow-callout", "Left Arrow Callout" },
-{ "right-arrow-callout", "Right Arrow Callout" },
-{ "up-arrow-callout", "Up Arrow Callout" },
-{ "down-arrow-callout", "Down Arrow Callout" },
-{ "left-right-arrow-callout", "Left and Right Arrow Callout" },
-{ "up-down-arrow-callout", "Up and Down Arrow Callout" },
-{ "quad-arrow-callout", "4-Way Arrow Callout" },
-{ "quad-bevel", "Square Bevel" },
-{ "left-bracket", "Left Bracket" },
-{ "right-bracket", "Right Bracket" },
-{ "left-brace", "Left Brace" },
-{ "right-brace", "Right Brace" },
-{ "mso-spt89", "Up and Left Arrow" },
-//{ "mso-spt90", mso_sptBentUpArrow },
-/

core.git: svx/source

2024-05-03 Thread Noel Grandin (via logerrit)
 svx/source/svdraw/presetooxhandleadjustmentrelations.cxx |  493 +++
 1 file changed, 246 insertions(+), 247 deletions(-)

New commits:
commit 980fb234ca9c380e1560b07a43f16abbcbeb7a8f
Author: Noel Grandin 
AuthorDate: Thu May 2 13:41:38 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat May 4 08:19:40 2024 +0200

replace createFromAscii with OUString literals in svx

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

diff --git a/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx 
b/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx
index 528c8b35cd50..592632dc7196 100644
--- a/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx
+++ b/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx
@@ -25,7 +25,7 @@ struct HandleAdjRel
 // Shape name without leading "ooxml-", underscore, zero based handle index
 // e.g. The third handle in shape of type "ooxml-circularArrow" will be
 // identified by key "circularArrow_2"
-const char* sShape_Handle;
+OUString sShape_Handle;
 
 // 4 tokens with separator "|"
 // first: RefX or RefR, na if not exists
@@ -35,256 +35,256 @@ struct HandleAdjRel
 // e.g. The third handle in shape  has in the preset
 // the tag  .
 // The resulting value in the map here is "RefR|adj5|na|na"
-const char* sAdjReferences;
+OUString sAdjReferences;
 };
 
 // The array initializer has been extracted from
 // oox/source/drawingml/customshapes/presetShapeDefinitions.xml
 // by using an XSLT file. That file is attached to tdf#126512.
 constexpr HandleAdjRel aHandleAdjRelArray[]
-= { { "accentBorderCallout1_0", "RefX|adj2|RefY|adj1" },
-{ "accentBorderCallout1_1", "RefX|adj4|RefY|adj3" },
-{ "accentBorderCallout2_0", "RefX|adj2|RefY|adj1" },
-{ "accentBorderCallout2_1", "RefX|adj4|RefY|adj3" },
-{ "accentBorderCallout2_2", "RefX|adj6|RefY|adj5" },
-{ "accentBorderCallout3_0", "RefX|adj2|RefY|adj1" },
-{ "accentBorderCallout3_1", "RefX|adj4|RefY|adj3" },
-{ "accentBorderCallout3_2", "RefX|adj6|RefY|adj5" },
-{ "accentBorderCallout3_3", "RefX|adj8|RefY|adj7" },
-{ "accentCallout1_0", "RefX|adj2|RefY|adj1" },
-{ "accentCallout1_1", "RefX|adj4|RefY|adj3" },
-{ "accentCallout2_0", "RefX|adj2|RefY|adj1" },
-{ "accentCallout2_1", "RefX|adj4|RefY|adj3" },
-{ "accentCallout2_2", "RefX|adj6|RefY|adj5" },
-{ "accentCallout3_0", "RefX|adj2|RefY|adj1" },
-{ "accentCallout3_1", "RefX|adj4|RefY|adj3" },
-{ "accentCallout3_2", "RefX|adj6|RefY|adj5" },
-{ "accentCallout3_3", "RefX|adj8|RefY|adj7" },
-{ "arc_0", "na|na|RefAngle|adj1" },
-{ "arc_1", "na|na|RefAngle|adj2" },
-{ "bentArrow_0", "RefX|adj1|na|na" },
-{ "bentArrow_1", "na|na|RefY|adj2" },
-{ "bentArrow_2", "RefX|adj3|na|na" },
-{ "bentArrow_3", "RefX|adj4|na|na" },
-{ "bentConnector3_0", "RefX|adj1|na|na" },
-{ "bentConnector4_0", "RefX|adj1|na|na" },
-{ "bentConnector4_1", "na|na|RefY|adj2" },
-{ "bentConnector5_0", "RefX|adj1|na|na" },
-{ "bentConnector5_1", "na|na|RefY|adj2" },
-{ "bentConnector5_2", "RefX|adj3|na|na" },
-{ "bentUpArrow_0", "na|na|RefY|adj1" },
-{ "bentUpArrow_1", "RefX|adj2|na|na" },
-{ "bentUpArrow_2", "na|na|RefY|adj3" },
-{ "bevel_0", "RefX|adj|na|na" },
-{ "blockArc_0", "na|na|RefAngle|adj1" },
-{ "blockArc_1", "RefR|adj3|RefAngle|adj2" },
-{ "borderCallout1_0", "RefX|adj2|RefY|adj1" },
-{ "borderCallout1_1", "RefX|adj4|RefY|adj3" },
-{ "borderCallout2_0", "RefX|adj2|RefY|adj1" },
-{ "borderCallout2_1", "RefX|adj4|RefY|adj3" },
-{ "borderCallout2_2", "RefX|adj6|RefY|adj5" },
-{ "borderCallout3_0", "RefX|adj2|RefY|adj1" },
-{ "borderCallout3_1", "RefX|adj4|RefY|adj3" },
-{ "borderCallout3_2", "RefX|adj6|RefY|adj5" },
-{ "borderCallout3_3", "RefX|adj8|RefY|adj7" },
-{ "bracePair_0", "na|na|RefY|adj" },
-{ "bracketPair_0", "na|na|RefY|adj" },
-{ "callout1_0", "RefX|adj2|RefY|adj1" },
-{ "callout1_1", "RefX|adj4|RefY|adj3" },
-{ "callout2_0", "RefX|adj2|RefY|adj1" },
-{ "callout2_1", "RefX|adj4|RefY|adj3" },
-{ "callout2_2", "RefX|adj6|RefY|adj5" },
-{ "callout3_0", "RefX|adj2|RefY|adj1" },
-{ "callout3_1", "RefX|adj4|RefY|adj3" },
-{ "callout3_2", "RefX|adj6|RefY|adj5" },
-{ "callout3_3", "RefX|adj8|RefY|adj7" },
-{ "can_0", "na|na|RefY|adj" },
-{ "chevron_0", "RefX|adj|na|na" },
-{ "chord_0", "na|na|RefAngle|adj1" },
-{ "chord_1", "na|na|RefAngle|adj2" },
-{ "circularArrow_0", "na|na|RefAngle|adj2" },
-{ "circularArrow_1", "na|na|RefAng

core.git: svx/source

2024-05-03 Thread Noel Grandin (via logerrit)
 svx/source/form/formcontrolfactory.cxx |  263 -
 1 file changed, 128 insertions(+), 135 deletions(-)

New commits:
commit 544bc99ba834263a6800c05bbd08df3cca3a6e1a
Author: Noel Grandin 
AuthorDate: Thu May 2 13:38:49 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri May 3 19:34:33 2024 +0200

replace createFromAscii with OUString literals in svx

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

diff --git a/svx/source/form/formcontrolfactory.cxx 
b/svx/source/form/formcontrolfactory.cxx
index dc879a084802..540c4e80e7de 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -204,135 +204,134 @@ namespace svxform
 }
 
 
-const char* aCharacterAndParagraphProperties[] =
+constexpr OUString aCharacterAndParagraphProperties[]
 {
-"CharFontName",
-"CharFontStyleName",
-"CharFontFamily",
-"CharFontCharSet",
-"CharFontPitch",
-"CharColor",
-"CharEscapement",
-"CharHeight",
-"CharUnderline",
-"CharWeight",
-"CharPosture",
-"CharAutoKerning",
-"CharBackColor",
-"CharBackTransparent",
-"CharCaseMap",
-"CharCrossedOut",
-"CharFlash",
-"CharStrikeout",
-"CharWordMode",
-"CharKerning",
-"CharLocale",
-"CharKeepTogether",
-"CharNoLineBreak",
-"CharShadowed",
-"CharFontType",
-"CharStyleName",
-"CharContoured",
-"CharCombineIsOn",
-"CharCombinePrefix",
-"CharCombineSuffix",
-"CharEmphasize",
-"CharRelief",
-"RubyText",
-"RubyAdjust",
-"RubyCharStyleName",
-"RubyIsAbove",
-"CharRotation",
-"CharRotationIsFitToLine",
-"CharScaleWidth",
-"HyperLinkURL",
-"HyperLinkTarget",
-"HyperLinkName",
-"VisitedCharStyleName",
-"UnvisitedCharStyleName",
-"CharEscapementHeight",
-"CharNoHyphenation",
-"CharUnderlineColor",
-"CharUnderlineHasColor",
-"CharStyleNames",
-"CharHeightAsian",
-"CharWeightAsian",
-"CharFontNameAsian",
-"CharFontStyleNameAsian",
-"CharFontFamilyAsian",
-"CharFontCharSetAsian",
-"CharFontPitchAsian",
-"CharPostureAsian",
-"CharLocaleAsian",
-"ParaIsCharacterDistance",
-"ParaIsForbiddenRules",
-"ParaIsHangingPunctuation",
-"CharHeightComplex",
-"CharWeightComplex",
-"CharFontNameComplex",
-"CharFontStyleNameComplex",
-"CharFontFamilyComplex",
-"CharFontCharSetComplex",
-"CharFontPitchComplex",
-"CharPostureComplex",
-"CharLocaleComplex",
-"ParaAdjust",
-"ParaLineSpacing",
-"ParaBackColor",
-"ParaBackTransparent",
-"ParaBackGraphic",
-"ParaBackGraphicURL",
-"ParaBackGraphicFilter",
-"ParaBackGraphicLocation",
-"ParaLastLineAdjust",
-"ParaExpandSingleWord",
-"ParaLeftMargin",
-"ParaRightMargin",
-"ParaTopMargin",
-"ParaBottomMargin",
-"ParaLineNumberCount",
-"ParaLineNumberStartValue",
-"PageDescName",
-"PageNumberOffset",
-"ParaRegisterModeActive",
-"ParaTabStops",
-"ParaStyleName",
-"DropCapFormat",
-"DropCapWholeWord",
-"ParaKeepTogether",
-"Setting",
-"ParaSplit",
-"Setting",
-"NumberingLevel",
-"NumberingRules",
-"NumberingStartValue",
-"ParaIsNumberingRestart",
-"NumberingStyleName",
-"ParaOrphans",
-"ParaWidows",
-"ParaShadowFormat",
-"LeftBorder",
-"RightBorder",
-"TopBorder",
-"BottomBorder",
-"BorderDistance",
-"LeftBorderDistance",
-"RightBorderDistance",
-"TopBorderDistance",
-"BottomBorderDistance",
-"BreakType",
-"DropCapCharStyleName",
-"ParaFirstLineIndent",
-"ParaIsAutoFirstLineIndent",
-"ParaIsHyphenation",
-"ParaHyphenationMaxHyphens",
-"ParaHyphenationMaxLeadingChars",
-"ParaHyphenationMaxTrailingChars",
- 

core.git: svx/source

2024-05-01 Thread Noel Grandin (via logerrit)
 svx/source/xoutdev/xtable.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 764f944d55cd21cb9ace6b51e8e173b7a4acd21d
Author: Noel Grandin 
AuthorDate: Wed May 1 20:35:27 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu May 2 08:20:46 2024 +0200

use more OUString in XPropertyList

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

diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx
index e640c18b64e9..e842e5e854cc 100644
--- a/svx/source/xoutdev/xtable.cxx
+++ b/svx/source/xoutdev/xtable.cxx
@@ -369,15 +369,15 @@ XPropertyList::CreatePropertyListFromURL( 
XPropertyListType t,
 
 struct {
 XPropertyListType t;
-const char *pExt;
-} const pExtnMap[] = {
-{ XPropertyListType::Color,"soc" },
-{ XPropertyListType::LineEnd, "soe" },
-{ XPropertyListType::Dash, "sod" },
-{ XPropertyListType::Hatch,"soh" },
-{ XPropertyListType::Gradient, "sog" },
-{ XPropertyListType::Bitmap,   "sob" },
-{ XPropertyListType::Pattern,  "sop"}
+OUString aExt;
+} constexpr pExtnMap[] = {
+{ XPropertyListType::Color,u"soc"_ustr },
+{ XPropertyListType::LineEnd, u"soe"_ustr },
+{ XPropertyListType::Dash, u"sod"_ustr },
+{ XPropertyListType::Hatch,u"soh"_ustr },
+{ XPropertyListType::Gradient, u"sog"_ustr },
+{ XPropertyListType::Bitmap,   u"sob"_ustr },
+{ XPropertyListType::Pattern,  u"sop"_ustr}
 };
 
 OUString XPropertyList::GetDefaultExt( XPropertyListType t )
@@ -385,7 +385,7 @@ OUString XPropertyList::GetDefaultExt( XPropertyListType t )
 for (const auto & i : pExtnMap)
 {
 if( i.t == t )
-return OUString::createFromAscii( i.pExt );
+return i.aExt;
 }
 return OUString();
 }


core.git: svx/source

2024-04-25 Thread Xisco Fauli (via logerrit)
 svx/source/dialog/svxruler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 90548039f09d4bc773bf6879a62d544adfa175db
Author: Xisco Fauli 
AuthorDate: Thu Apr 25 15:52:29 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu Apr 25 20:47:41 2024 +0200

svx: Avoid divide by 0

See 
https://crashreport.libreoffice.org/stats/signature/SvxRuler::UpdateTabs()

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

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6323583fd271..17c4edaa930d 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1033,7 +1033,7 @@ void SvxRuler::UpdateTabs()
 lCurrentDefTabDist = mxTabStopItem->GetDefaultDistance();
 tools::Long nDefTabDist = ConvertHPosPixel(lCurrentDefTabDist);
 
-const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent
+const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent || nDefTabDist == 0
 ? 0
 : static_cast( (lRightIndent - lPosPixel) / 
nDefTabDist );
 


core.git: svx/source

2024-04-20 Thread Mike Kaganski (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 992c821416817534c53338665e254c0dc554ea51
Author: Mike Kaganski 
AuthorDate: Sat Apr 20 18:20:13 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sat Apr 20 16:53:45 2024 +0200

Simplify a bit

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

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 8dafb00778a5..d4a7b45beb8f 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -40,11 +40,7 @@ struct B2DPointCompare
 {
 bool operator()(const basegfx::B2DPoint& lhs, const basegfx::B2DPoint& 
rhs) const
 {
-if (lhs.getX() < rhs.getX())
-return true;
-if (lhs.getX() > rhs.getX())
-return false;
-return lhs.getY() < rhs.getY();
+return std::make_pair(lhs.getX(), lhs.getY()) < 
std::make_pair(rhs.getX(), rhs.getY());
 }
 };
 
@@ -52,11 +48,7 @@ struct B2DPointCompareYThenX
 {
 bool operator()(const basegfx::B2DPoint& lhs, const basegfx::B2DPoint& 
rhs) const
 {
-if (lhs.getY() < rhs.getY())
-return true;
-if (lhs.getY() > rhs.getY())
-return false;
-return lhs.getX() < rhs.getX();
+return std::make_pair(lhs.getY(), lhs.getX()) < 
std::make_pair(rhs.getY(), rhs.getX());
 }
 };
 


core.git: svx/source

2024-04-20 Thread Noel Grandin (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |  141 +---
 1 file changed, 128 insertions(+), 13 deletions(-)

New commits:
commit e5bc241d197ed946fc4a2ba4901e25c7f82cab85
Author: Noel Grandin 
AuthorDate: Wed Apr 3 16:12:12 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 20 14:55:40 2024 +0200

cool#8571 use better algorithm for generating selection overlay

when we know that the selection overlay consists purely of rectanges, we
can use a faster algorithm to generate the combined polygon

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

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 9644650263c9..8dafb00778a5 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -31,33 +31,149 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
+namespace
+{
+struct B2DPointCompare
+{
+bool operator()(const basegfx::B2DPoint& lhs, const basegfx::B2DPoint& 
rhs) const
+{
+if (lhs.getX() < rhs.getX())
+return true;
+if (lhs.getX() > rhs.getX())
+return false;
+return lhs.getY() < rhs.getY();
+}
+};
+
+struct B2DPointCompareYThenX
+{
+bool operator()(const basegfx::B2DPoint& lhs, const basegfx::B2DPoint& 
rhs) const
+{
+if (lhs.getY() < rhs.getY())
+return true;
+if (lhs.getY() > rhs.getY())
+return false;
+return lhs.getX() < rhs.getX();
+}
+};
+
+}
 
 namespace sdr::overlay
 {
-// combine rages geometrically to a single, ORed polygon
-static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const 
std::vector< basegfx::B2DRange >& rRanges)
+
+// Combine rectangles geometrically to a single OR'ed polygon.
+// Algorithm is from
+// "Uniqueness of orthogonal connect-the-dots" Joseph O'Rourke 1988
+// The basic algorithm is:
+//   Sort points by lowest x, lowest y
+//   Go through each column and create edges between the vertices 2i and 
2i + 1 in that column
+//   Sort points by lowest y, lowest x
+//   Go through each row and create edges between the vertices 2i and 2i + 
1 in that row.
+//
+static basegfx::B2DPolyPolygon impCombineRectanglesToPolyPolygon(const 
std::vector< basegfx::B2DRange >& rRectangles)
+{
+o3tl::sorted_vector sort_x;
+for (auto const & rRect : rRectangles)
 {
-const sal_uInt32 nCount(rRanges.size());
-basegfx::B2DPolyPolygon aRetval;
+auto checkPoint = [&sort_x](double x, double y)
+{
+basegfx::B2DPoint pt(x, y);
+auto it = sort_x.find(pt);
+if (it != sort_x.end()) // Shared vertice, remove it.
+sort_x.erase(it);
+else
+sort_x.insert(pt);
+};
+checkPoint(rRect.getMinX(), rRect.getMinY());
+checkPoint(rRect.getMinX(), rRect.getMaxY());
+checkPoint(rRect.getMaxX(), rRect.getMinY());
+checkPoint(rRect.getMaxX(), rRect.getMaxY());
+}
+
+
+o3tl::sorted_vector sort_y;
+for (auto const & i : sort_x)
+sort_y.insert(i);
 
-for(sal_uInt32 a(0); a < nCount; a++)
+std::map 
edges_h;
+std::map 
edges_v;
+
+size_t i = 0;
+while (i < sort_x.size())
+{
+auto curr_y = sort_y[i].getY();
+while (i < sort_x.size() && sort_y[i].getY() == curr_y)
+{
+edges_h[sort_y[i]] = sort_y[i + 1];
+edges_h[sort_y[i + 1]] = sort_y[i];
+i += 2;
+}
+}
+i = 0;
+while (i < sort_x.size())
+{
+auto curr_x = sort_x[i].getX();
+while (i < sort_x.size() && sort_x[i].getX() == curr_x)
 {
-const basegfx::B2DPolygon 
aDiscretePolygon(basegfx::utils::createPolygonFromRect(rRanges[a]));
+edges_v[sort_x[i]] = sort_x[i + 1];
+edges_v[sort_x[i + 1]] = sort_x[i];
+i += 2;
+}
+}
 
-if(0 == a)
+// Get all the polygons.
+basegfx::B2DPolyPolygon aPolyPolygon;
+std::vector> tmpPolygon;
+while (!edges_h.empty())
+{
+tmpPolygon.clear();
+// We can start with any point.
+basegfx::B2DPoint pt = edges_h.begin()->first;
+edges_h.erase(edges_h.begin());
+tmpPolygon.push_back({pt, false});
+for (;;)
+{
+auto [curr, e] = tmpPolygon.back();
+if (!e)
 {
-aRetval.append(aDiscretePolygon);
+auto it

core.git: svx/source

2024-04-19 Thread Noel Grandin (via logerrit)
 svx/source/sdr/overlay/overlayselection.cxx |   98 +---
 1 file changed, 48 insertions(+), 50 deletions(-)

New commits:
commit 7b1405689d4246e0e37e8759f03e1962af964cec
Author: Noel Grandin 
AuthorDate: Fri Apr 19 22:56:04 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 20 07:42:08 2024 +0200

reduce the number of drawing primitives we create in OverlaySelection

and flatten it a little

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

diff --git a/svx/source/sdr/overlay/overlayselection.cxx 
b/svx/source/sdr/overlay/overlayselection.cxx
index 89ef1202e125..9644650263c9 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -92,63 +92,61 @@ namespace sdr::overlay
 drawinglayer::primitive2d::Primitive2DContainer 
OverlaySelection::createOverlayObjectPrimitive2DSequence()
 {
 drawinglayer::primitive2d::Primitive2DContainer aRetval;
-const sal_uInt32 nCount(getRanges().size());
+const sal_uInt32 nCount(maRanges.size());
 
-if(nCount)
-{
-// create range primitives
-const bool bInvert(OverlayType::Invert == maLastOverlayType);
-basegfx::BColor aRGBColor(getBaseColor().getBColor());
-aRetval.resize(nCount);
+if(!nCount)
+return aRetval;
 
-if(bInvert)
-{
-// force color to white for invert to get a full invert
-aRGBColor = basegfx::BColor(1.0, 1.0, 1.0);
-}
+// create range primitives
+const bool bInvert(OverlayType::Invert == maLastOverlayType);
+basegfx::BColor aRGBColor(getBaseColor().getBColor());
+if(bInvert)
+{
+// force color to white for invert to get a full invert
+aRGBColor = basegfx::BColor(1.0, 1.0, 1.0);
+}
 
-for(sal_uInt32 a(0);a < nCount; a++)
-{
-const basegfx::B2DPolygon 
aPolygon(basegfx::utils::createPolygonFromRect(maRanges[a]));
-aRetval[a] =
-new 
drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
-basegfx::B2DPolyPolygon(aPolygon),
-aRGBColor);
-}
+basegfx::B2DPolyPolygon aPolyPolygon;
+aPolyPolygon.reserve(nCount);
+for(sal_uInt32 a(0);a < nCount; a++)
+
aPolyPolygon.append(basegfx::utils::createPolygonFromRect(maRanges[a]));
+aRetval.append(
+new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+std::move(aPolyPolygon),
+aRGBColor));
 
-if(bInvert)
+if(bInvert)
+{
+// embed all in invert primitive
+aRetval = drawinglayer::primitive2d::Primitive2DContainer {
+new drawinglayer::primitive2d::InvertPrimitive2D(
+std::move(aRetval))
+};
+}
+else if(OverlayType::Transparent == maLastOverlayType)
+{
+// embed all rectangles in transparent paint
+const double fTransparence(mnLastTransparence / 100.0);
+drawinglayer::primitive2d::Primitive2DReference 
aUnifiedTransparence(
+new 
drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
+std::move(aRetval),
+fTransparence));
+
+if(mbBorder)
 {
-// embed all in invert primitive
-aRetval = drawinglayer::primitive2d::Primitive2DContainer {
-new drawinglayer::primitive2d::InvertPrimitive2D(
-std::move(aRetval))
-};
+basegfx::B2DPolyPolygon 
aBorderPolyPolygon(impCombineRangesToPolyPolygon(maRanges));
+drawinglayer::primitive2d::Primitive2DReference 
aSelectionOutline(
+new 
drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+std::move(aBorderPolyPolygon),
+aRGBColor));
+
+// add both to result
+aRetval = drawinglayer::primitive2d::Primitive2DContainer 
{ aUnifiedTransparence, aSelectionOutline };
 }
-else if(OverlayType::Transparent == maLastOverlayType)
+else
 {
-// embed all rectangles in transparent paint
-const double fTransparence(mnLastTransparence / 100.0);
-  

core.git: svx/source

2024-04-05 Thread Aaron Bourdeaux (via logerrit)
 svx/source/sdr/contact/viewcontactofsdrole2obj.cxx |4 +---
 svx/source/sdr/overlay/overlaybitmapex.cxx |2 +-
 svx/source/sdr/overlay/overlaytools.cxx|6 +++---
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit ee9a21da6aa0872855f78a4464d6952e11a9aa54
Author: Aaron Bourdeaux 
AuthorDate: Fri Mar 29 19:12:59 2024 -0400
Commit: Ilmari Lauhakangas 
CommitDate: Fri Apr 5 13:15:46 2024 +0200

tdf#160084 Simplify comparison for basegfx::fTools

Change-Id: I61bcc0054c71273945d3004839be92a25a26d261
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165563
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index e6386e7c0a92..0c206f6edb07 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -99,9 +99,7 @@ void 
ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(drawinglay
 const double fWidth(aChartContentRange.getWidth());
 const double fHeight(aChartContentRange.getHeight());
 
-if(!aChartSequence.empty()
-&& basegfx::fTools::more(fWidth, 0.0)
-&& basegfx::fTools::more(fHeight, 0.0))
+if(!aChartSequence.empty() && fWidth > 0.0 && fHeight > 0.0)
 {
 // create embedding transformation
 basegfx::B2DHomMatrix aEmbed(
diff --git a/svx/source/sdr/overlay/overlaybitmapex.cxx 
b/svx/source/sdr/overlay/overlaybitmapex.cxx
index 3ffba9e05747..6dc31ff8eb2c 100644
--- a/svx/source/sdr/overlay/overlaybitmapex.cxx
+++ b/svx/source/sdr/overlay/overlaybitmapex.cxx
@@ -35,7 +35,7 @@ namespace sdr::overlay
 mfShearX,
 mfRotation));
 
-if(basegfx::fTools::more(mfAlpha, 0.0))
+if(mfAlpha > 0.0)
 {
 drawinglayer::primitive2d::Primitive2DContainer 
aNewTransPrimitiveVector { aReference };
 aReference = new 
drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aNewTransPrimitiveVector),
 mfAlpha);
diff --git a/svx/source/sdr/overlay/overlaytools.cxx 
b/svx/source/sdr/overlay/overlaytools.cxx
index 8b857ad53ee8..2755b7fa3030 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -62,7 +62,7 @@ Primitive2DReference 
OverlayStaticRectanglePrimitive::create2DDecomposition(cons
 maPosition.getX() - fHalfWidth, maPosition.getY() - fHalfHeight,
 maPosition.getX() + fHalfWidth, maPosition.getY() + fHalfHeight);
 
-if (!basegfx::fTools::more(getDiscreteUnit(), 0.0) || mfTransparence > 1.0)
+if (getDiscreteUnit() <= 0.0 || mfTransparence > 1.0)
 return nullptr;
 
 basegfx::B2DPolygon aPolygon(
@@ -138,7 +138,7 @@ sal_uInt32 
OverlayStaticRectanglePrimitive::getPrimitive2DID() const
 {
 const Size aBitmapSize(getBitmapEx().GetSizePixel());
 
-if(!aBitmapSize.Width() || !aBitmapSize.Height() || 
!basegfx::fTools::more(getDiscreteUnit(), 0.0))
+if(!aBitmapSize.Width() || !aBitmapSize.Height() || 
getDiscreteUnit() <= 0.0)
 return nullptr;
 
 // calculate back from internal bitmap's extreme coordinates (the 
edges)
@@ -287,7 +287,7 @@ sal_uInt32 
OverlayStaticRectanglePrimitive::getPrimitive2DID() const
 Primitive2DReference aRetval;
 basegfx::B2DRange aInnerRange(getObjectRange());
 
-if(aInnerRange.isEmpty() || 
!basegfx::fTools::more(getDiscreteUnit(), 0.0) || getTransparence() > 1.0)
+if(aInnerRange.isEmpty() || getDiscreteUnit() <= 0.0 || 
getTransparence() > 1.0)
 return nullptr;
 
 if 
(!Application::GetSettings().GetStyleSettings().GetHighContrastMode())


core.git: svx/source

2024-04-03 Thread Andrea Gelmini (via logerrit)
 svx/source/unodraw/unoshape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2e6c853b8ecf42f829ec039336bdd7b8574ace2c
Author: Andrea Gelmini 
AuthorDate: Wed Apr 3 12:32:59 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed Apr 3 14:26:51 2024 +0200

Fix typo

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

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 0d5be8555330..95d6ba37304c 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1681,7 +1681,7 @@ void SAL_CALL SvxShape::setPropertyValues( const 
css::uno::Sequence< OUString >&
 }
 catch (beans::UnknownPropertyException&)
 {
-// ignore, various code likes to opportunisticly set 
properties on objects that don't support those properties
+// ignore, various code likes to opportunistically set 
properties on objects that don't support those properties
 }
 catch (uno::Exception&)
 {


core.git: svx/source

2024-04-02 Thread Gabor Kelemen (via logerrit)
 svx/source/dialog/dlgctrl.cxx   |1 -
 svx/source/dialog/fntctrl.cxx   |3 ---
 svx/source/dialog/searchcharmap.cxx |2 --
 svx/source/dialog/srchdlg.cxx   |2 --
 svx/source/fmcomp/dbaexchange.cxx   |1 -
 svx/source/fmcomp/dbaobjectex.cxx   |2 --
 svx/source/form/dataaccessdescriptor.cxx|1 -
 svx/source/form/fmdocumentclassification.cxx|1 -
 svx/source/form/fmobj.cxx   |2 --
 svx/source/form/fmshell.cxx |1 -
 svx/source/form/fmtextcontrolshell.cxx  |1 -
 svx/source/form/fmtools.cxx |4 
 svx/source/form/fmview.cxx  |3 ---
 svx/source/form/navigatortreemodel.cxx  |3 ---
 svx/source/form/sdbdatacolumn.cxx   |2 --
 svx/source/form/sqlparserclient.cxx |2 --
 svx/source/sidebar/media/MediaPlaybackPanel.hxx |1 -
 svx/source/sidebar/nbdtmg.cxx   |1 -
 svx/source/table/accessiblecell.cxx |1 -
 svx/source/table/accessibletableshape.cxx   |2 --
 svx/source/table/cell.cxx   |1 -
 svx/source/table/cellrange.cxx  |1 -
 svx/source/table/tablecolumns.cxx   |1 -
 svx/source/table/tablelayouter.cxx  |1 -
 svx/source/table/tablerows.cxx  |1 -
 svx/source/table/tableundo.cxx  |1 -
 svx/source/tbxctrls/extrusioncontrols.cxx   |1 -
 svx/source/tbxctrls/fillctrl.cxx|2 --
 svx/source/tbxctrls/fontworkgallery.cxx |1 -
 svx/source/tbxctrls/grafctrl.cxx|2 --
 svx/source/tbxctrls/itemwin.cxx |1 -
 svx/source/tbxctrls/linectrl.cxx|1 -
 svx/source/tbxctrls/linewidthctrl.cxx   |5 -
 svx/source/toolbars/extrusionbar.cxx|1 -
 svx/source/toolbars/fontworkbar.cxx |1 -
 svx/source/unodraw/UnoGraphicExporter.cxx   |1 -
 svx/source/unodraw/tableshape.cxx   |3 ---
 svx/source/unodraw/unoshap2.cxx |1 -
 svx/source/unodraw/unoshap4.cxx |1 -
 svx/source/unodraw/unoshape.cxx |1 -
 svx/source/xml/xmleohlp.cxx |1 -
 svx/source/xml/xmlxtimp.cxx |1 -
 42 files changed, 66 deletions(-)

New commits:
commit 704e71b9d13054a7e21a037663de4feacae2ef25
Author: Gabor Kelemen 
AuthorDate: Fri Mar 29 14:09:14 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Wed Apr 3 08:50:52 2024 +0200

tdf#146619 Drop unused 'using namespace' in: svx/

Change-Id: Ic8b925a3ec55166a9d5da05827d2cb335943b665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165542
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 456a369fcd16..d68a68faa4d3 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -48,7 +48,6 @@
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
 // Control for display and selection of the corner points and
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index b0723c8e65c1..ad9c5fc62c49 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -66,9 +66,6 @@
 //an arbitrary number of characters
 #define TEXT_WIDTH 80
 
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
 
 // small helper functions to set fonts
 
diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index 7284bfd0874b..c1c289d6366d 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -31,8 +31,6 @@
 
 #include 
 
-using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star;
 
 
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 93d593d8729f..481124e3c963 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -76,9 +76,7 @@
 #include 
 #include 
 
-using namespace com::sun::star::i18n;
 using namespace com::sun::star::uno;
-using namespace com::sun::star::accessibility;
 using namespace com::sun::star;
 using namespace comphelper;
 
diff --git a/svx/source/fmcomp/dbaexchange.cxx 
b/svx/source/fmcomp/dbaexchange.cxx
index 904740e38877..8b2c869fd611 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -38,7 +38,6 @@ namespace svx
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::sdb;
 using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
 using namespace ::com

core.git: svx/source

2024-04-01 Thread Patrick Luby (via logerrit)
 svx/source/svdraw/svdpntv.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 053f7f9ff5a475446da2855e2e71f3ea0ef18791
Author: Patrick Luby 
AuthorDate: Mon Apr 1 10:01:03 2024 -0400
Commit: Patrick Luby 
CommitDate: Mon Apr 1 19:27:17 2024 +0200

tdf#160444 check device's owner window is a nullptr

Since commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1, the
device's owner window gets deleted before this object is
deleted.

Change-Id: I15dc8db60e5520c2f0e73a9a117f25af15845caf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165637
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 86535232d288..09583787fa24 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -858,7 +858,12 @@ void SdrPaintView::InvalidateAllWin(const 
tools::Rectangle& rRect)
 void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice)
 {
 // do not erase background, that causes flicker (!)
-rDevice.GetOwnerWindow()->Invalidate(InvalidateFlags::NoErase);
+// tdf#160444 check device's owner window is a nullptr
+// Since commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1, the
+// device's owner window gets deleted before this object is
+// deleted.
+if (rDevice.GetOwnerWindow())
+rDevice.GetOwnerWindow()->Invalidate(InvalidateFlags::NoErase);
 }
 
 void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice, const 
tools::Rectangle& rRect)


core.git: svx/source

2024-03-25 Thread Oliver Specht (via logerrit)
 svx/source/gallery2/galbrws1.cxx |   25 -
 svx/source/inc/galbrws1.hxx  |1 +
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 203b6a00cf5b716cb580d2bd4e9a6071cec23574
Author: Oliver Specht 
AuthorDate: Tue Mar 19 13:16:07 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Mon Mar 25 16:59:06 2024 +0100

tdf#160264 Fixed crash in gallery

Local gallery themes need an additional listener to prevent deleting
the global theme.

Change-Id: If6cfcb5a3eeffdc087b089f2151c45b2cff87bbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165029
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index c68c2d8ba83e..443d9be4adec 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -256,7 +256,7 @@ void GalleryBrowser1::ImplFillExchangeData( const 
GalleryTheme* pThm, ExchangeDa
 
 void GalleryBrowser1::ImplGetExecuteVector(std::vector& o_aExec)
 {
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), *this );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), maLocalListner );
 
 if( !pTheme )
 return;
@@ -288,14 +288,14 @@ void 
GalleryBrowser1::ImplGetExecuteVector(std::vector& o_aExec)
 
 o_aExec.emplace_back("properties");
 
-mpGallery->ReleaseTheme( pTheme, *this );
+mpGallery->ReleaseTheme( pTheme, maLocalListner );
 }
 
 void GalleryBrowser1::ImplGalleryThemeProperties( std::u16string_view 
rThemeName, bool bCreateNew )
 {
 DBG_ASSERT(!mpThemePropsDlgItemSet, "mpThemePropsDlgItemSet already set!");
 mpThemePropsDlgItemSet.reset(new SfxItemSet( SfxGetpApp()->GetPool() ));
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, *this );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListner );
 
 ImplFillExchangeData( pTheme, *mpExchangeData );
 
@@ -345,7 +345,7 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties(bool 
bCreateNew, sal_Int32 n
 }
 
 OUString aThemeName( mpExchangeData->pTheme->GetName() );
-mpGallery->ReleaseTheme( mpExchangeData->pTheme, *this );
+mpGallery->ReleaseTheme( mpExchangeData->pTheme, maLocalListner );
 
 if ( bCreateNew && ( nRet != RET_OK ) )
 {
@@ -367,13 +367,13 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 {
 if (rIdent == u"update")
 {
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), *this );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( 
GetSelectedTheme(), maLocalListner );
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
 ScopedVclPtr 
aActualizeProgress(pFact->CreateActualizeProgressDialog(mxThemes.get(), 
pTheme));
 
 aActualizeProgress->Execute();
-mpGallery->ReleaseTheme( pTheme, *this );
+mpGallery->ReleaseTheme( pTheme, maLocalListner );
 }
 else if (rIdent == u"delete")
 {
@@ -384,7 +384,7 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 }
 else if (rIdent == u"rename")
 {
-GalleryTheme*   pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
*this );
+GalleryTheme*   pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
maLocalListner );
 const OUString  aOldName( pTheme->GetName() );
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -407,11 +407,11 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 mpGallery->RenameTheme( aOldName, aName );
 }
 }
-mpGallery->ReleaseTheme( pTheme, *this );
+mpGallery->ReleaseTheme( pTheme, maLocalListner );
 }
 else if (rIdent == u"assign")
 {
-GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
*this );
+GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), 
maLocalListner );
 
 if (pTheme && !pTheme->IsReadOnly())
 {
@@ -422,7 +422,7 @@ void GalleryBrowser1::ImplExecute(std::u16string_view 
rIdent)
 pTheme->SetId( aDlg->GetId(), true );
 }
 
-mpGallery->ReleaseTheme( pTheme, *this );
+mpGallery->ReleaseTheme( pTheme, maLocalListner );
 }
 else if (rIdent == u"properties")
 {
@@ -1500,13 +1500,12 @@ IMPL_LINK(GalleryBrowser1, SelectTbxHdl, 
weld::Toggleable&, rBox, void)
 
 void GalleryBrowser1::FillThemeEntries()
 {
-SfxListener aListener;
 for (size_t i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; 
++i)
 {
 const GalleryThemeEntry* pThemeInfo = mpGallery->GetThemeInfo( i );
 OUString aThemeName = pThemeInfo->GetThemeName();
 //sal_uInt32 nId = pThemeInfo->GetId();
-GalleryTheme* pTheme = mpGallery->AcquireTheme(aThemeName,

core.git: svx/source

2024-03-21 Thread Christopher Loi (via logerrit)
 svx/source/inc/celltypes.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 7c76332b52d9b3b967beecc1fe163eea783c471e
Author: Christopher Loi 
AuthorDate: Thu Mar 21 05:24:32 2024 -0700
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 21 18:54:30 2024 +0100

tdf#143148: Replace include guards with pragma once

Change-Id: I00cee3dc61231a0cc344d404eed4cedda41f4d7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165100
Reviewed-by: Christopher Loi 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/svx/source/inc/celltypes.hxx b/svx/source/inc/celltypes.hxx
index f70e386db8a4..7dfc9d10b4df 100644
--- a/svx/source/inc/celltypes.hxx
+++ b/svx/source/inc/celltypes.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SVX_SOURCE_INC_CELLTYPES_HXX
-#define INCLUDED_SVX_SOURCE_INC_CELLTYPES_HXX
+#pragma once
 
 #include 
 #include 
@@ -81,6 +80,4 @@ private:
 };
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: svx/source

2024-03-13 Thread Arnaud VERSINI (via logerrit)
 svx/source/form/fmscriptingenv.cxx | 1055 ++---
 1 file changed, 528 insertions(+), 527 deletions(-)

New commits:
commit 2ced3022d2c3a534a1e3ac6f5cd12cdf870c2151
Author: Arnaud VERSINI 
AuthorDate: Tue Dec 26 18:21:29 2023 +0100
Commit: Noel Grandin 
CommitDate: Wed Mar 13 17:23:22 2024 +0100

svx : use string view to avoid OUString creation

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

diff --git a/svx/source/form/fmscriptingenv.cxx 
b/svx/source/form/fmscriptingenv.cxx
index db7904174b0a..dd01ddf842bc 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -41,6 +41,7 @@
 #include 
 
 #include 
+#include 
 
 using std::pair;
 
@@ -102,7 +103,7 @@ namespace svxform
 @return
  if and only if the method is declared 
oneway, i.e. can be called asynchronously
 */
-static bool impl_allowAsynchronousCall_nothrow( const OUString& 
_rListenerType, const OUString& _rMethodName );
+static bool impl_allowAsynchronousCall_nothrow( std::u16string_view 
_rListenerType, std::u16string_view _rMethodName );
 
 /** determines whether the instance is already disposed
 */
@@ -140,538 +141,538 @@ namespace svxform
 }
 
 
-bool FormScriptListener::impl_allowAsynchronousCall_nothrow( const 
OUString& _rListenerType, const OUString& _rMethodName )
+bool FormScriptListener::impl_allowAsynchronousCall_nothrow( 
std::u16string_view _rListenerType, std::u16string_view _rMethodName )
 {
 // This used to be implemented as:
 // is (_rListenerType + "::" + _rMethodName) a oneway function?
 // since we got rid of the notion of oneway, this is the list
 // of oneway methods, autogenerated by postprocessing of
 // commitdiff 90eac3e69749a9227c4b6902b1f3cef1e338c6d1
-static const o3tl::sorted_vector> 
delayed_event_listeners{
-
pair("com.sun.star.accessibility.XAccessibleComponent","grabFocus"),
-
pair("com.sun.star.accessibility.XAccessibleEventBroadcaster","addAccessibleEventListener"),
-
pair("com.sun.star.accessibility.XAccessibleEventBroadcaster","removeAccessibleEventListener"),
-
pair("com.sun.star.accessibility.XAccessibleSelection","clearAccessibleSelection"),
-
pair("com.sun.star.accessibility.XAccessibleSelection","selectAllAccessibleChildren"),
-
pair("com.sun.star.awt.XActionListener","actionPerformed"),
-
pair("com.sun.star.awt.XActivateListener","windowActivated"),
-
pair("com.sun.star.awt.XActivateListener","windowDeactivated"),
-
pair("com.sun.star.awt.XAdjustmentListener","adjustmentValueChanged"),
-
pair("com.sun.star.awt.XButton","addActionListener"),
-
pair("com.sun.star.awt.XButton","removeActionListener"),
-pair("com.sun.star.awt.XButton","setLabel"),
-
pair("com.sun.star.awt.XButton","setActionCommand"),
-
pair("com.sun.star.awt.XCheckBox","addItemListener"),
-
pair("com.sun.star.awt.XCheckBox","removeItemListener"),
-pair("com.sun.star.awt.XCheckBox","setState"),
-pair("com.sun.star.awt.XCheckBox","setLabel"),
-
pair("com.sun.star.awt.XCheckBox","enableTriState"),
-
pair("com.sun.star.awt.XComboBox","addItemListener"),
-
pair("com.sun.star.awt.XComboBox","removeItemListener"),
-
pair("com.sun.star.awt.XComboBox","addActionListener"),
-
pair("com.sun.star.awt.XComboBox","removeActionListener"),
-pair("com.sun.star.awt.XComboBox","addItem"),
-pair("com.sun.star.awt.XComboBox","addItems"),
-
pair("com.sun.star.awt.XComboBox","removeItems"),
-
pair("com.sun.star.awt.XComboBox","setDropDownLineCount"),
-pair("com.sun.star.awt.XControl","setContext"),
-pair("com.sun.star.awt.XControl","createPeer"),
-
pair("com.sun.star.awt.XControl","setDesignMode"),
-
pair("com.sun.star.awt.XControlContainer","setStatusText"),
-
pair("com.sun.star.awt.XControlContainer","addControl"),
-
pair("com.sun.star.awt.XControlContainer","removeControl"),
-
pair("com.sun.star.awt.XCurrencyField","setValue"),
-
pair("com.sun.star.awt.XCurrencyField","setMin"),
-
pair("com.sun.star.awt.XCurrencyField","setMax"),
-
pair("com.sun.star.awt.XCurrencyField","setFirst"),
-
pair("com.sun.star.awt.XCurrencyField","setLast"),
-
pair("com.sun.star.awt.XCurrencyField","setSpinSize"),
-
pair("com.sun.star.awt.XCurrencyField","setDecimalDigits"),
-
pair("com.sun.star.awt.XCurrencyField","setStrictFormat"),
-pair("com.sun.star.awt.XDateF

core.git: svx/source

2024-03-11 Thread Pranam Lashkari (via logerrit)
 svx/source/svdraw/svdedxv.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f8bb64a3cffb80793a6b3b9c41f78c5feccb168e
Author: Pranam Lashkari 
AuthorDate: Mon Mar 11 21:03:30 2024 +0530
Commit: Caolán McNamara 
CommitDate: Mon Mar 11 21:48:33 2024 +0100

LOK: send LOK_CALLBACK_SHAPE_INNER_TEXT info on empty textbox initialization

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

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f60baf1b64fe..799d51f85930 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2513,7 +2513,10 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& 
rSet, bool bReplaceAll)
 
 Outliner* pTEOutliner = mpTextEditOutlinerView->GetOutliner();
 if (pTEOutliner && pTEOutliner->IsModified())
+{
 GetModel().SetChanged();
+SetInnerTextAreaForLOKit();
+}
 
 ImpMakeTextCursorAreaVisible();
 }


core.git: svx/source

2024-03-08 Thread Noel Grandin (via logerrit)
 svx/source/sdr/properties/textproperties.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 6a3b20b14d32922c99df4ad65271499d0a8d663e
Author: Noel Grandin 
AuthorDate: Fri Mar 8 19:51:30 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 8 21:38:46 2024 +0100

tdf#158773 do the cheap checks first

the HasText() call inside TextProperties::Notify is surprisingly
expensive, so only do it when we know we are interested.

Shaves 25% off the load time here

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

diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index 220d6a528ef1..90c68df3fa2a 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -550,15 +550,15 @@ namespace sdr::properties
 // call parent
 AttributeProperties::Notify(rBC, rHint);
 
-SdrTextObj& rObj = static_cast(GetSdrObject());
-if(!rObj.HasText())
-return;
-
 SfxHintId nId(rHint.GetId());
-const svx::ITextProvider& rTextProvider(getTextProvider());
 
 if(SfxHintId::DataChanged == nId && rBC.IsSfxStyleSheet())
 {
+SdrTextObj& rObj = static_cast(GetSdrObject());
+if(!rObj.HasText())
+return;
+
+const svx::ITextProvider& rTextProvider(getTextProvider());
 sal_Int32 nText = rTextProvider.getTextCount();
 while (nText--)
 {
@@ -580,6 +580,11 @@ namespace sdr::properties
 }
 else if(SfxHintId::Dying == nId && rBC.IsSfxStyleSheet())
 {
+SdrTextObj& rObj = static_cast(GetSdrObject());
+if(!rObj.HasText())
+return;
+
+const svx::ITextProvider& rTextProvider(getTextProvider());
 sal_Int32 nText = rTextProvider.getTextCount();
 while (nText--)
 {
@@ -598,6 +603,7 @@ namespace sdr::properties
 
 if(aOldName != aNewName)
 {
+const svx::ITextProvider& rTextProvider(getTextProvider());
 sal_Int32 nText = rTextProvider.getTextCount();
 while (nText--)
 {


core.git: svx/source

2024-03-07 Thread Noel Grandin (via logerrit)
 svx/source/sdr/properties/attributeproperties.cxx |  124 +++---
 1 file changed, 66 insertions(+), 58 deletions(-)

New commits:
commit 4a30c919373940025024442d9607da06258bb552
Author: Noel Grandin 
AuthorDate: Thu Mar 7 12:48:20 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 7 16:50:10 2024 +0100

tdf#158773 reduce dynamic_cast in AttributeProperties::Notify

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

diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index 9fc67078a847..641ebe438154 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -419,84 +419,92 @@ namespace sdr::properties
 {
 bool bHintUsed(false);
 
-const SfxStyleSheetHint* pStyleHint = dynamic_cast(&rHint);
-
-if(pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet())
+SfxHintId id = rHint.GetId();
+if (id == SfxHintId::StyleSheetCreated
+|| id == SfxHintId::StyleSheetChanged
+|| id == SfxHintId::StyleSheetErased
+|| id == SfxHintId::StyleSheetModified
+|| id == SfxHintId::StyleSheetInDestruction
+|| id == SfxHintId::StyleSheetModifiedExtended)
 {
-SdrObject& rObj = GetSdrObject();
-//SdrPage* pPage = rObj.GetPage();
+const SfxStyleSheetHint* pStyleHint = static_cast(&rHint);
 
-switch(pStyleHint->GetId())
+if(pStyleHint->GetStyleSheet() == GetStyleSheet())
 {
-case SfxHintId::StyleSheetCreated :
-{
-// cannot happen, nothing to do
-break;
-}
-case SfxHintId::StyleSheetModified:
-case SfxHintId::StyleSheetModifiedExtended:
-case SfxHintId::StyleSheetChanged :
-{
-// notify change
-break;
-}
-case SfxHintId::StyleSheetErased  :
-case SfxHintId::StyleSheetInDestruction   :
+SdrObject& rObj = GetSdrObject();
+//SdrPage* pPage = rObj.GetPage();
+
+switch(id)
 {
-// Style needs to be exchanged
-SfxStyleSheet* pNewStSh = nullptr;
-SdrModel& rModel(rObj.getSdrModelFromSdrObject());
-
-// Do nothing if object is in destruction, else a 
StyleSheet may be found from
-// a StyleSheetPool which is just being deleted 
itself. and thus it would be fatal
-// to register as listener to that new StyleSheet.
-if(!rObj.IsInDestruction())
+case SfxHintId::StyleSheetCreated :
 {
-if(SfxStyleSheet* pStyleSheet = GetStyleSheet())
+// cannot happen, nothing to do
+break;
+}
+case SfxHintId::StyleSheetModified:
+case SfxHintId::StyleSheetModifiedExtended:
+case SfxHintId::StyleSheetChanged :
+{
+// notify change
+break;
+}
+case SfxHintId::StyleSheetErased  :
+case SfxHintId::StyleSheetInDestruction   :
+{
+// Style needs to be exchanged
+SfxStyleSheet* pNewStSh = nullptr;
+SdrModel& rModel(rObj.getSdrModelFromSdrObject());
+
+// Do nothing if object is in destruction, else a 
StyleSheet may be found from
+// a StyleSheetPool which is just being deleted 
itself. and thus it would be fatal
+// to register as listener to that new StyleSheet.
+if(!rObj.IsInDestruction())
 {
-pNewStSh = 
static_cast(rModel.GetStyleSheetPool()->Find(
-pStyleSheet->GetParent(), 
pStyleSheet->GetFamily()));
+if(SfxStyleSheet* pStyleSheet = 
GetStyleSheet())
+{
+pNewStSh = 
static_cast(rModel.GetStyleSheetPool()->Find(
+

core.git: svx/source

2024-03-07 Thread Mike Kaganski (via logerrit)
 svx/source/sdr/contact/viewcontactofgraphic.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 860548e23e2ae737d7bd5840f71f776b1239f997
Author: Mike Kaganski 
AuthorDate: Thu Mar 7 08:54:59 2024 +0100
Commit: Mike Kaganski 
CommitDate: Thu Mar 7 10:59:18 2024 +0100

Simplify a comparison

Comparing with zero is simple - the implementation of 
basegfx::fTools::moreOrEqual
calls rtl_math_approxEqual eventually, which special-zases zero.

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

diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index eee994c583cc..1135bd48bc91 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -112,7 +112,7 @@ namespace sdr::contact
 const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 
2.0);
 const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 
2.0);
 
-if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && 
basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
+if (fOffsetX >= 0.0 && fOffsetY >= 0.0)
 {
 // create the EmptyPresObj fallback visualisation. The 
fallback graphic
 // is already provided in rGraphicObject in this case, use it


core.git: svx/source

2024-03-06 Thread Noel Grandin (via logerrit)
 svx/source/sdr/properties/textproperties.cxx |   60 ---
 1 file changed, 27 insertions(+), 33 deletions(-)

New commits:
commit 3b784236d7c3bf386deeeadcf79d9e9b289bf991
Author: Noel Grandin 
AuthorDate: Wed Mar 6 14:12:51 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 6 19:58:47 2024 +0100

tdf#158773 reduce cost of TextProperties::Notify

Shaves 30% off the load time here, by re-arranging the logic so we do th
expensive dynamic_cast less often

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

diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index 55b366bdc03b..17f63d044dcf 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -554,50 +554,44 @@ namespace sdr::properties
 if(!rObj.HasText())
 return;
 
+SfxHintId nId(rHint.GetId());
 const svx::ITextProvider& rTextProvider(getTextProvider());
-if(dynamic_cast(&rBC) != nullptr)
-{
-SfxHintId nId(rHint.GetId());
 
-if(SfxHintId::DataChanged == nId)
+if(SfxHintId::DataChanged == nId && dynamic_cast(&rBC) != nullptr)
+{
+sal_Int32 nText = rTextProvider.getTextCount();
+while (nText--)
 {
-sal_Int32 nText = rTextProvider.getTextCount();
-while (nText--)
-{
-OutlinerParaObject* pParaObj = rTextProvider.getText( 
nText )->GetOutlinerParaObject();
-if( pParaObj )
-pParaObj->ClearPortionInfo();
-}
-rObj.SetTextSizeDirty();
-
-if(rObj.IsTextFrame() && 
rObj.NbcAdjustTextFrameWidthAndHeight())
-{
-// here only repaint wanted
-rObj.ActionChanged();
-//rObj.BroadcastObjectChange();
-}
+OutlinerParaObject* pParaObj = rTextProvider.getText( 
nText )->GetOutlinerParaObject();
+if( pParaObj )
+pParaObj->ClearPortionInfo();
+}
+rObj.SetTextSizeDirty();
 
-// #i101556# content of StyleSheet has changed -> new 
version
-maVersion++;
+if(rObj.IsTextFrame() && 
rObj.NbcAdjustTextFrameWidthAndHeight())
+{
+// here only repaint wanted
+rObj.ActionChanged();
+//rObj.BroadcastObjectChange();
 }
 
-if(SfxHintId::Dying == nId)
+// #i101556# content of StyleSheet has changed -> new version
+maVersion++;
+}
+else if(SfxHintId::Dying == nId && dynamic_cast(&rBC) != nullptr)
+{
+sal_Int32 nText = rTextProvider.getTextCount();
+while (nText--)
 {
-sal_Int32 nText = rTextProvider.getTextCount();
-while (nText--)
-{
-OutlinerParaObject* pParaObj = rTextProvider.getText( 
nText )->GetOutlinerParaObject();
-if( pParaObj )
-pParaObj->ClearPortionInfo();
-}
+OutlinerParaObject* pParaObj = rTextProvider.getText( 
nText )->GetOutlinerParaObject();
+if( pParaObj )
+pParaObj->ClearPortionInfo();
 }
 }
-else if(dynamic_cast(&rBC) != 
nullptr)
+else if (nId == SfxHintId::StyleSheetModified && 
dynamic_cast(&rBC) != nullptr)
 {
 const SfxStyleSheetModifiedHint* pExtendedHint = 
dynamic_cast(&rHint);
-
-if(pExtendedHint
-&& SfxHintId::StyleSheetModified == pExtendedHint->GetId())
+if (pExtendedHint)
 {
 const OUString& aOldName(pExtendedHint->GetOldName());
 OUString 
aNewName(pExtendedHint->GetStyleSheet()->GetName());


core.git: svx/source

2024-03-06 Thread Noel Grandin (via logerrit)
 svx/source/sdr/properties/customshapeproperties.cxx |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit f1552be34859d92865067c296b328770c83580e7
Author: Noel Grandin 
AuthorDate: Wed Mar 6 15:09:44 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 6 19:27:52 2024 +0100

tdf#158773 reduce dynamic_cast'ing in CustomShapeProperties::Notify

shaves 2% off the load time

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

diff --git a/svx/source/sdr/properties/customshapeproperties.cxx 
b/svx/source/sdr/properties/customshapeproperties.cxx
index cbad73ab78c2..c48e4d3833d4 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -205,18 +205,12 @@ namespace sdr::properties
 TextProperties::Notify( rBC, rHint );
 
 bool bRemoveRenderGeometry = false;
-const SfxStyleSheetHint* pStyleHint = dynamic_cast(&rHint);
 
-if ( pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet() )
+if (rHint.GetId() == SfxHintId::StyleSheetModified || 
rHint.GetId() == SfxHintId::StyleSheetChanged)
 {
-switch( pStyleHint->GetId() )
-{
-case SfxHintId::StyleSheetModified :
-case SfxHintId::StyleSheetChanged  :
-bRemoveRenderGeometry = true;
-break;
-default: break;
-}
+const SfxStyleSheetHint* pStyleHint = static_cast(&rHint);
+if ( pStyleHint->GetStyleSheet() == GetStyleSheet() )
+bRemoveRenderGeometry = true;
 }
 else if ( rHint.GetId() == SfxHintId::DataChanged )
 {


core.git: svx/source

2024-03-04 Thread Caolán McNamara (via logerrit)
 svx/source/form/labelitemwindow.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 82bfc24c9ceb00a730580ad9338ead2f64437d05
Author: Caolán McNamara 
AuthorDate: Mon Mar 4 10:57:18 2024 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 4 20:26:08 2024 +0100

GLib-GObject-CRITICAL **: gsignal.c:2778: instance X has no handler with id 
Y

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

diff --git a/svx/source/form/labelitemwindow.cxx 
b/svx/source/form/labelitemwindow.cxx
index c9afd1534acc..91d9f99c0ce9 100644
--- a/svx/source/form/labelitemwindow.cxx
+++ b/svx/source/form/labelitemwindow.cxx
@@ -58,7 +58,9 @@ OUString LabelItemWindow::get_label() const { return 
m_xLabel->get_label(); }
 
 void LabelItemWindow::dispose()
 {
+m_xImage.reset();
 m_xLabel.reset();
+m_xBox.reset();
 InterimItemWindow::dispose();
 }
 


core.git: svx/source

2024-03-03 Thread Caolán McNamara (via logerrit)
 svx/source/svdraw/svdotextdecomposition.cxx |   40 +++-
 1 file changed, 33 insertions(+), 7 deletions(-)

New commits:
commit 5dab4eb854609d5d84bb0bfa918f0a5bf0459b53
Author: Caolán McNamara 
AuthorDate: Sun Mar 3 14:53:19 2024 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 3 17:42:29 2024 +0100

Resolves: tdf#159696 Small capitals with 'Individual words' underlining

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

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 3fe9de6fb7ba..5736f26f51b7 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -327,13 +328,38 @@ namespace
 const 
drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
 static_cast(pNewPrimitive.get());
 
-pTCPP->CreateDecorationGeometryContent(
-aContainer,
-pTCPP->getTextTransform(),
-caseMappedText,
-rInfo.mnTextStart,
-rInfo.mnTextLen,
-aDXArray);
+if (pTCPP->getWordLineMode()) // single word mode: 'Individual 
words' in UI
+{
+// Split to single word primitives using TextBreakupHelper
+drawinglayer::primitive2d::TextBreakupHelper 
aTextBreakupHelper(*pTCPP);
+drawinglayer::primitive2d::Primitive2DContainer 
aBroken(aTextBreakupHelper.extractResult(drawinglayer::primitive2d::BreakupUnit::Word));
+for (auto& rPortion : aBroken)
+{
+assert(rPortion->getPrimitive2DID() == 
PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D &&
+   "TextBreakupHelper generates same output 
primitive type as input");
+
+const 
drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D* pPortion =
+static_cast(rPortion.get());
+
+pPortion->CreateDecorationGeometryContent(
+aContainer,
+pPortion->getTextTransform(),
+caseMappedText,
+pPortion->getTextPosition(),
+pPortion->getTextLength(),
+pPortion->getDXArray());
+}
+}
+else
+{
+pTCPP->CreateDecorationGeometryContent(
+aContainer,
+pTCPP->getTextTransform(),
+caseMappedText,
+rInfo.mnTextStart,
+rInfo.mnTextLen,
+aDXArray);
+}
 }
 
 pNewPrimitive = new 
drawinglayer::primitive2d::GroupPrimitive2D(std::move(aContainer));


core.git: svx/source

2024-03-03 Thread Andrea Gelmini (via logerrit)
 svx/source/svdraw/svdedxv.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6524ec07b0ff311b1beac7a5b58df763052f2b91
Author: Andrea Gelmini 
AuthorDate: Sat Mar 2 23:16:01 2024 +0100
Commit: Julien Nabet 
CommitDate: Sun Mar 3 09:33:25 2024 +0100

Fix typo

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

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3685cd55a8ef..fb130a16a212 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -136,7 +136,7 @@ IMPL_LINK_NOARG(SdrObjEditView, TextEditUpdate, Timer*, 
void)
 // no TextObject, no TextEdit
 return;
 
-// lauch an ObjectChange: This is the straightforward method
+// launch an ObjectChange: This is the straightforward method
 // to get this broadcasted. We do not risk to set the model
 // unwantedly to changed, we had a text edit going on already.
 // This is needed for SlideShow since it is not (yet) using the


core.git: svx/source

2024-03-01 Thread Pranam Lashkari (via logerrit)
 svx/source/svdraw/svdmrkv.cxx |   52 +-
 1 file changed, 51 insertions(+), 1 deletion(-)

New commits:
commit 948cd8b9f62e28883b691084a9bb83177422defd
Author: Pranam Lashkari 
AuthorDate: Wed Feb 28 04:55:46 2024 +0530
Commit: Caolán McNamara 
CommitDate: Fri Mar 1 21:39:07 2024 +0100

LOK: send inner text boundry information of shapes/textbox

Sends inner rectangle boundry info as part of 
LOK_CALLBACK_GRAPHIC_SELECTION message

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index b0784449f159..b9a492aa35ad 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,6 +61,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include 
@@ -759,6 +762,30 @@ bool 
SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree)
 return result;
 }
 
+namespace
+{
+class TextBoundsExtractor final : public 
drawinglayer::processor2d::TextExtractor2D
+{
+private:
+basegfx::B2DRange maTextRange;
+void processTextPrimitive2D(const 
drawinglayer::primitive2d::BasePrimitive2D& rCandidate) override
+{
+maTextRange.expand(rCandidate.getB2DRange(getViewInformation2D()));
+}
+public:
+explicit TextBoundsExtractor(const 
drawinglayer::geometry::ViewInformation2D& rViewInformation)
+: drawinglayer::processor2d::TextExtractor2D(rViewInformation)
+{
+}
+
+basegfx::B2DRange getTextBounds(const sdr::contact::ViewObjectContact 
&rVOC, sdr::contact::DisplayInfo &raDisplayInfo)
+{
+this->process(rVOC.getPrimitive2DSequence(raDisplayInfo));
+return maTextRange;
+}
+};
+}
+
 void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const 
SfxViewShell* pOtherShell)
 {
 SfxViewShell* pViewShell = GetSfxViewShell();
@@ -837,6 +864,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 bConnectorSelection = dumpGluePointsToJSON(aGluePointsTree);
 }
 
+SdrPageView* pPageView = GetSdrPageView();
+
 if (GetMarkedObjectCount())
 {
 SdrMark* pM = GetSdrMarkByIndex(0);
@@ -853,6 +882,27 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 + "\",\"type\":"
 + 
OString::number(static_cast(pO->GetObjIdentifier(;
 
+if (mpMarkedObj && !pOtherShell)
+{
+const sdr::contact::ViewObjectContact& rVOC = 
mpMarkedObj->GetViewContact().GetViewObjectContact(
+pPageView->GetPageWindow(0)->GetObjectContact());
+
+sdr::contact::DisplayInfo aDisplayInfo;
+TextBoundsExtractor 
aTextBoundsExtractor(rVOC.GetObjectContact().getViewInformation2D());
+basegfx::B2DRange aRange = 
aTextBoundsExtractor.getTextBounds(rVOC, aDisplayInfo);
+if (!aRange.isEmpty()) {
+tools::Rectangle rect(aRange.getMinX(), aRange.getMinY(), 
aRange.getMaxX(), aRange.getMaxY());
+tools::Rectangle aRangeTWIP = o3tl::convert(rect, 
o3tl::Length::mm100, o3tl::Length::twip);
+OString innerTextInfo = ",\"innerTextRect\":[" +
+OString::number(aRangeTWIP.getX()) + "," +
+OString::number(aRangeTWIP.getY()) + "," +
+OString::number(aRangeTWIP.GetWidth()) + "," +
+OString::number(aRangeTWIP.GetHeight()) + "]";
+
+aExtraInfo.append(innerTextInfo);
+}
+}
+
 // In core, the gridOffset is calculated based on the LogicRect's 
TopLeft coordinate
 // In online, we have the SnapRect and we calculate it based on 
its TopLeft coordinate
 // SnapRect's TopLeft and LogicRect's TopLeft match unless there 
is rotation
@@ -862,7 +912,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 // whether the shape is rotated or not, we will always have the 
correct gridOffset
 // Note that the gridOffset is calculated from the first selected 
obj
 basegfx::B2DVector aGridOffset(0.0, 0.0);
-if(getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), GetSdrPageView()))
+if(getPossibleGridOffsetForSdrObject(aGridOffset, 
GetMarkedObjectByIndex(0), pPageView))
 {
 Point p(aGridOffset.getX(), aGridOffset.getY());
 if (convertMapMode)


core.git: svx/source

2024-02-29 Thread Henry Castro (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit c6d9cc16dbb5fe0d05ce8ca9c4c18b989596e928
Author: Henry Castro 
AuthorDate: Wed Feb 28 15:59:40 2024 -0400
Commit: Caolán McNamara 
CommitDate: Thu Feb 29 21:40:54 2024 +0100

svx: fix default locale language string

1) Open a spreadsheet
2) Format a cell with a currency. Example USD $ English (USA)
3) Open the sidebar if it's not opened already
4) Click in the currency dropdown
5) Observe: there is $ (Default)

Expected result: USD $ English (USA) Default

Signed-off-by: Henry Castro 
Change-Id: Idf7f4174557e59cb6f5ffd65c25572322a5794ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164123
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a07a1b752d5d..4a366730b76d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -4124,12 +4124,19 @@ void 
SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList,
 {
 rCurrencyList.clear();
 
+constexpr OUString aTwoSpace = u"  "_ustr;
 const NfCurrencyTable& rCurrencyTable = 
SvNumberFormatter::GetTheCurrencyTable();
 sal_uInt16 nCount = rCurrencyTable.size();
 
 sal_uInt16 nStart = 1;
 
-OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol() ) 
+ " " );
+LanguageTag eLangTag = Application::GetSettings().GetLanguageTag();
+OUString 
aString(ApplyLreOrRleEmbedding(rCurrencyTable[0].GetBankSymbol()));
+aString += aTwoSpace;
+aString += ApplyLreOrRleEmbedding(rCurrencyTable[0].GetSymbol());
+aString += aTwoSpace;
+aString += 
ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(eLangTag.getLanguageType()));
+aString += aTwoSpace;
 aString += 
ApplyLreOrRleEmbedding(SvtLanguageTable::GetLanguageString(rCurrencyTable[0].GetLanguage()));
 
 rList.push_back( aString );
@@ -4143,9 +4150,7 @@ void 
SvxCurrencyToolBoxControl::GetCurrencySymbols(std::vector& rList,
 }
 
 CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() );
-aCollator.loadDefaultCollator( 
Application::GetSettings().GetLanguageTag().getLocale(), 0 );
-
-static constexpr OUString aTwoSpace(u"  "_ustr);
+aCollator.loadDefaultCollator(eLangTag.getLocale(), 0);
 
 for( sal_uInt16 i = 1; i < nCount; ++i )
 {


core.git: svx/source

2024-02-27 Thread Stephan Bergmann (via logerrit)
 svx/source/sdr/contact/objectcontactofpageview.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ef6798919a514fc0043f4cd050ffb244696bbda3
Author: Stephan Bergmann 
AuthorDate: Tue Feb 27 10:27:25 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Feb 28 08:47:33 2024 +0100

Avoid calling back into an SdrMarkView that is being destroyed

The recently added CppunitTest_sc_tiledrendering
CPPUNIT_TEST_NAME=testEditShapeText::TestBody had started to cause

> svx/source/svdraw/sdrpagewindow.cxx:471:56: runtime error: member call on 
address 0x51dc4480 which does not point to an object of type 'SdrMarkView'
> 0x51dc4480: note: object is of type 'SdrPaintView'
>  00 00 00 00  30 1f 13 bc ca 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 
00 00 00 00 00  03 00 00 00
>   ^~~
>   vptr for 'SdrPaintView'
>  #0 in SdrPageWindow::InvalidatePageWindow(basegfx::B2DRange const&) at 
svx/source/svdraw/sdrpagewindow.cxx:471:56
>  #1 in 
sdr::contact::ObjectContactOfPageView::InvalidatePartOfView(basegfx::B2DRange 
const&) const at svx/source/sdr/contact/objectcontactofpageview.cxx:357:29
>  #2 in sdr::contact::ViewObjectContact::triggerLazyInvalidate() at 
svx/source/sdr/contact/viewobjectcontact.cxx:267:28
>  #3 in sdr::contact::ObjectContactOfPageView::Invoke() at 
svx/source/sdr/contact/objectcontactofpageview.cxx:105:29
>  #4 in sdr::contact::ObjectContactOfPageView::~ObjectContactOfPageView() 
at svx/source/sdr/contact/objectcontactofpageview.cxx:74:13
>  #5 in sdr::contact::ObjectContactOfPageView::~ObjectContactOfPageView() 
at svx/source/sdr/contact/objectcontactofpageview.cxx:72:9
>  #6 in SdrPageWindow::ResetObjectContact() at 
svx/source/svdraw/sdrpagewindow.cxx:520:9
>  #7 in SdrPageWindow::~SdrPageWindow() at 
svx/source/svdraw/sdrpagewindow.cxx:130:5
>  #8 in std::default_delete::operator()(SdrPageWindow*) 
const at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:93:2
>  #9 in std::unique_ptr>::~unique_ptr() at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:398:4
>  #10 in void std::destroy_at>>(std::unique_ptr>*) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:88:15
>  #11 in void std::_Destroy>>(std::unique_ptr>*) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:149:7
>  #12 in void 
std::_Destroy_aux::__destroy>*>(std::unique_ptr>*, std::unique_ptr>*) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:163:6
>  #13 in void std::_Destroy>*>(std::unique_ptr>*, std::unique_ptr>*) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:195:7
>  #14 in void std::_Destroy>*, std::unique_ptr>>(std::unique_ptr>*, std::unique_ptr>*, 
std::allocator>>&) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/alloc_traits.h:941:7
>  #15 in std::__cxx1998::vector>, 
std::allocator>>>::~vector() at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_vector.h:732:2
>  #16 in std::__debug::vector>, 
std::allocator>>>::~vector() at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/debug/vector:245:25
>  #17 in SdrPageView::~SdrPageView() at svx/source/svdraw/svdpagv.cxx:122:1
>  #18 in std::default_delete::operator()(SdrPageView*) const 
at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:93:2
>  #19 in std::__uniq_ptr_impl>::reset(SdrPageView*) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:205:4
>  #20 in std::unique_ptr>::reset(SdrPageView*) at 
~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:503:7
>  #21 in SdrPaintView::ClearPageView() at 
svx/source/svdraw/svdpntv.cxx:356:20
>  #22 in SdrPaintView::~SdrPaintView() at 
svx/source/svdraw/svdpntv.cxx:189:5
>  #23 in SdrSnapView::~SdrSnapView() at svx/source/svdraw/svdsnpv.cxx:199:1
>  #24 in SdrMarkView::~SdrMarkView() at svx/source/svdraw/svdmrkv.cxx:197:1
>  #25 in SdrEditView::~SdrEditView() at svx/source/svdraw/svdedtv.cxx:126:1
>  #26 in SdrPolyEditView::~SdrPolyEditView() at 
svx/source/svdraw/svdpoev.cxx:58:1
>  #27 in SdrGlueEditView::~SdrGlueEditView() at 
svx/source/svdraw/svdglev.cxx:40:1
>  #28 in SdrObjEditView::~SdrObjEditView() at 
svx/source/svdraw/svdedxv.cxx:101:1
>  #29 in SdrExchangeView::~SdrExchangeView() at 
include/svx/svdxcgv.hxx:27:25
>  #30 in SdrDragView::~SdrDragView() at svx/source/svdraw/svddrgv.cxx:69:1
>  #31 in SdrCreateView::~SdrCreateView() at 
svx

core.git: svx/source

2024-02-26 Thread Mike Kaganski (via logerrit)
 svx/source/dialog/langbox.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit a1a1d8edb9d4a62b747aa7069b3026e2ba75704d
Author: Mike Kaganski 
AuthorDate: Tue Feb 27 01:13:32 2024 +0600
Commit: Mike Kaganski 
CommitDate: Tue Feb 27 01:57:35 2024 +0100

Another attempt to ensure strict weak ordering when sorting

The failure that Stephan noticed turns out to show a problem in the
data - the use of the special LANGUAGE_USER_SYSTEM_CONFIG language
type value. It should not appear in the sorted part of the list; if
needed, it should be added explicitly, like the "default" entry is
handled in SvxLanguageBox::SetLanguageList.

So simplify the shortcut in GenericFirst::operator() again, and
drop the special entries before sorting.

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

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index e8b82e3ac63c..8699a6798d59 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -219,8 +219,8 @@ static void SortLanguages(std::vector& 
rEntries)
 bool operator()(const EntryData& e1, const EntryData& e2) const
 {
 assert(e1.tag.getLanguage() == e2.tag.getLanguage());
-if (e1.entry.sId == e2.entry.sId || e1.tag.equals(e2.tag))
-return false; // shortcut; make sure to also compare tags, to 
resolve system locale
+if (e1.entry.sId == e2.entry.sId)
+return false; // shortcut
 
 // Make sure that e.g. generic 'Spanish {es}' goes before 'Spanish 
(Argentina)'.
 // We can't depend on MsLangId::getPrimaryLanguage/getSubLanguage, 
because e.g.
@@ -267,7 +267,11 @@ static void 
SortLanguages(std::vector& rEntries)
 
 for (const auto& entry : rEntries)
 {
-LanguageTag tag(LanguageType(entry.sId.toInt32()));
+LanguageType languageType(entry.sId.toInt32());
+// Remove LANGUAGE_USER_SYSTEM_CONFIG special entry and friends from 
the list
+if (languageType >= LanguageType(0xFFE0))
+continue;
+LanguageTag tag(languageType);
 langToEntriesMap[tag.getLanguage()].insert({ tag, entry }); // also 
makes unique
 }
 


core.git: svx/source

2024-02-25 Thread Samuel Mehrbrodt (via logerrit)
 svx/source/dialog/svxbmpnumvalueset.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit db54b44c15ed234b54ed81998ec824f0770b1b3c
Author: Samuel Mehrbrodt 
AuthorDate: Thu Feb 22 12:42:52 2024 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Feb 26 07:41:41 2024 +0100

Fix indentation

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

diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx 
b/svx/source/dialog/svxbmpnumvalueset.cxx
index 802e881ec1da..29dc2ddcc3df 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -440,9 +440,9 @@ void SvxNumValueSet::SetNumberingSettings(
 SetStyle( GetStyle()|WB_VSCROLL);
 for ( sal_Int32 i = 0; i < aNum.getLength(); i++ )
 {
-InsertItem( i + 1, i );
-if( i < 8 )
-SetItemText(i + 1, 
SvxResId(RID_SVXSTR_SINGLENUM_DESCRIPTIONS[i]));
+InsertItem(i + 1, i);
+if (i < 8)
+SetItemText(i + 1, SvxResId(RID_SVXSTR_SINGLENUM_DESCRIPTIONS[i]));
 }
 }
 


core.git: svx/source

2024-02-24 Thread Justin Luth (via logerrit)
 svx/source/sidebar/tools/ValueSetWithTextControl.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 72986a5e505f8b62b30aa890c136e07cef3f9a2b
Author: Justin Luth 
AuthorDate: Sat Feb 24 10:04:13 2024 -0500
Commit: Justin Luth 
CommitDate: Sat Feb 24 18:14:54 2024 +0100

tdf#159865 tdf#136905 NBB: font looked too small in page size choices

This fixes my 24.2 regression
from commit 1876feb8a8805b2f80537e2828c152ccbdf67fe2

I considered reverting it, but decided to tweak the font size instead.
If I reverted, the size of the choices was displayed in 16pt font.

I wanted to keep the sizing as "scientific" as possible,
but fixing the rounding issues didn't really make the font
stand out as much as desired.
In this case, my system font of 11 became 10 for the page size dialog,
due to rounding, which is still a significant 10%.

Although that still looks too small, it seems fairly close
to the other button on the notebook bar, at least to my eyes.
But it is definitely smaller/less clear than the "more option" button.

Perhaps it has to do with the visible size of a font
compared to the full size (with leading)? Fonts are often
sized as 11/13 or 12/14 for example.
Adding 20% to the font size makes it look about right.
In my case, it ends up chosing a font height of 13.

Change-Id: Ic0a7296aa74be542e2a38ce52cf5fd23e5d8c7f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163886
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx 
b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index 8919140b5d07..d55740315c99 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -45,8 +45,10 @@ void 
ValueSetWithTextControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 void ValueSetWithTextControl::SetOptimalDrawingAreaHeight()
 {
 const vcl::Font 
aFont(Application::GetSettings().GetStyleSettings().GetLabelFont());
-const sal_Int32 nRowHeight = aFont.GetFontSize().Height() * 9 / 4; // see 
UserDraw()
-const Size aSize(GetOutputSizePixel().Width(), nRowHeight * 
maItems.size());
+double fRowHeight = aFont.GetFontSize().Height() * 9 / 4.0; // see 
UserDraw()
+// It still looks too small. Probably the height specified should be the 
leading point size?
+fRowHeight *= 1.2; // add 20% leading
+const Size aSize(GetOutputSizePixel().Width(), fRowHeight * 
maItems.size());
 GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
 SetOutputSizePixel(aSize);
 }


core.git: svx/source

2024-02-20 Thread Oliver Specht (via logerrit)
 svx/source/svdraw/svdedxv.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 178d8a38e133aebd4cff1af2d2c49aec60468c92
Author: Oliver Specht 
AuthorDate: Mon Feb 19 09:52:46 2024 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Feb 20 16:49:37 2024 +0100

Make Clone Formatting in Impress similar to PP

In Powerpoint paragraph attributes are only applied from and to
fully/multiple selected paragraphs.

Change-Id: I7c1f3afb6c0d6fd9b3f8acf34cb5f5b3dcaf22d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163583
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index dbcc73a63cf1..f3f5d4818f20 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2780,7 +2780,7 @@ bool SdrObjEditView::SupportsFormatPaintbrush(SdrInventor 
nObjectInventor,
 }
 }
 
-static const WhichRangesContainer& GetFormatRangeImpl(bool bTextOnly)
+static const WhichRangesContainer& GetFormatRangeImpl(bool bTextOnly, bool 
withParagraphAttr = true)
 {
 static const WhichRangesContainer gFull(
 svl::Items);
 
 static const WhichRangesContainer gTextOnly(
+svl::Items);
+
+static const WhichRangesContainer gParaTextOnly(
 svl::Items);
 
-return bTextOnly ? gTextOnly : gFull;
+return bTextOnly ? withParagraphAttr ? gParaTextOnly : gTextOnly : gFull;
 }
 
 sal_Int32 SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr& 
rFormatSet)
@@ -2806,12 +2809,14 @@ sal_Int32 
SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr& rFor
 
 OutlinerView* pOLV = GetTextEditOutlinerView();
 
+bool isParaSelection = pOLV ? pOLV->GetEditView().IsSelectionFullPara() : 
false;
 rFormatSet = std::make_shared(GetModel().GetItemPool(),
-  GetFormatRangeImpl(pOLV != 
nullptr));
+  GetFormatRangeImpl(pOLV != 
nullptr, isParaSelection));
 if (pOLV)
 {
 rFormatSet->Put(pOLV->GetAttribs());
-nDepth = pOLV->GetDepth();
+if (isParaSelection)
+nDepth = pOLV->GetDepth();
 }
 else
 {
@@ -2979,10 +2984,11 @@ void SdrObjEditView::ApplyFormatPaintBrush(SfxItemSet& 
rFormatSet, sal_Int16 nDe
 const EditEngine& rEditEngine = pOutliner->GetEditEngine();
 
 ESelection aSel(pOLV->GetSelection());
+bool fullParaSelection
+= aSel.nEndPara != aSel.nStartPara || 
pOLV->GetEditView().IsSelectionFullPara();
 if (!aSel.HasRange())
 pOLV->SetSelection(rEditEngine.GetWord(aSel, 
css::i18n::WordType::DICTIONARY_WORD));
-
-const bool bRemoveParaAttribs = !bNoParagraphFormats;
+const bool bRemoveParaAttribs = !bNoParagraphFormats && 
!fullParaSelection;
 pOLV->RemoveAttribsKeepLanguages(bRemoveParaAttribs);
 SfxItemSet aSet(pOLV->GetAttribs());
 SfxItemSet aPaintSet(CreatePaintSet(GetFormatRangeImpl(true), 
*aSet.GetPool(),


core.git: svx/source

2024-02-12 Thread Noel Grandin (via logerrit)
 svx/source/svdraw/svdhdl.cxx |  101 +--
 1 file changed, 51 insertions(+), 50 deletions(-)

New commits:
commit bac09f76fd903c109b591a7bc15883e5653715ee
Author: Noel Grandin 
AuthorDate: Mon Feb 12 12:54:06 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 12 14:58:49 2024 +0100

tdf#159666 Crash when table and line object are selected at the same time

before
commit e3077168072452fb8f1c0a8afb2992877cb96d1c
Author: Noel Grandin 
Date:   Thu Jun 17 09:49:37 2021 +0200
loplugin:finalclasses
the cast in
   const SdrEdgeObj* pEdge = static_cast(m_pObj);
would incorrectly cast a SdrTableObj, but it happened to do nothing
problematic.

After the above commit, the vtable layout changed and it started
crashing.

Work around it by use dynamic_cast and ignoring objects that are not
SdrEdgeObj.

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

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index ad50c7680a5e..d32d01edb4bc 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1604,66 +1604,67 @@ ImpEdgeHdl::~ImpEdgeHdl()
 
 void ImpEdgeHdl::CreateB2dIAObject()
 {
-if(m_nObjHdlNum <= 1 && m_pObj)
+if(m_nObjHdlNum > 1 || !m_pObj)
 {
-// first throw away old one
-GetRidOfIAObject();
+// call parent
+SdrHdl::CreateB2dIAObject();
+return;
+}
 
-BitmapColorIndex eColIndex = BitmapColorIndex::LightCyan;
-BitmapMarkerKind eKindOfMarker = BitmapMarkerKind::Rect_7x7;
+// first throw away old one
+GetRidOfIAObject();
 
-if(m_pHdlList)
-{
-SdrMarkView* pView = m_pHdlList->GetView();
+BitmapColorIndex eColIndex = BitmapColorIndex::LightCyan;
+BitmapMarkerKind eKindOfMarker = BitmapMarkerKind::Rect_7x7;
 
-if(pView && !pView->areMarkHandlesHidden())
-{
-const SdrEdgeObj* pEdge = static_cast(m_pObj);
+if(!m_pHdlList)
+return;
 
-if(pEdge->GetConnectedNode(m_nObjHdlNum == 0) != nullptr)
-eColIndex = BitmapColorIndex::LightRed;
+SdrMarkView* pView = m_pHdlList->GetView();
 
-if(m_nPPntNum < 2)
-{
-// Handle with plus sign inside
-eKindOfMarker = BitmapMarkerKind::Circ_7x7;
-}
+if(!pView || pView->areMarkHandlesHidden())
+return;
 
-SdrPageView* pPageView = pView->GetSdrPageView();
+// tdf#159666 Crash when table and line object are selected at the same 
time
+auto pEdge = dynamic_cast(m_pObj);
+if (!pEdge)
+return;
 
-if(pPageView)
-{
-for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
-{
-const SdrPageWindow& rPageWindow = 
*pPageView->GetPageWindow(b);
-
-if(rPageWindow.GetPaintWindow().OutputToWindow())
-{
-const rtl::Reference< sdr::overlay::OverlayManager 
>& xManager = rPageWindow.GetOverlayManager();
-if (xManager.is())
-{
-basegfx::B2DPoint aPosition(m_aPos.X(), 
m_aPos.Y());
-std::unique_ptr 
pNewOverlayObject(CreateOverlayObject(
-aPosition,
-eColIndex,
-eKindOfMarker));
-
-// OVERLAYMANAGER
-insertNewlyCreatedOverlayObjectForSdrHdl(
-std::move(pNewOverlayObject),
-rPageWindow.GetObjectContact(),
-*xManager);
-}
-}
-}
-}
-}
-}
+if(pEdge->GetConnectedNode(m_nObjHdlNum == 0) != nullptr)
+eColIndex = BitmapColorIndex::LightRed;
+
+if(m_nPPntNum < 2)
+{
+// Handle with plus sign inside
+eKindOfMarker = BitmapMarkerKind::Circ_7x7;
 }
-else
+
+SdrPageView* pPageView = pView->GetSdrPageView();
+if(!pPageView)
+return;
+
+for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
 {
-// call parent
-SdrHdl::CreateB2dIAObject();
+const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+if(rPageWindow.GetPaintWindow().OutputToWindow())
+{
+const rtl::Reference< sdr::overlay::OverlayManager >& xManager = 
rPageWindow.GetOverlayManager();
+if (xManager.is())
+ 

core.git: svx/source

2024-02-10 Thread Regina Henschel (via logerrit)
 svx/source/sdr/contact/viewcontactofsdrpage.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 56517d8a38459f5a9e67327c1ac0dc8bcd07bcb8
Author: Regina Henschel 
AuthorDate: Fri Feb 9 15:02:41 2024 +0100
Commit: Regina Henschel 
CommitDate: Sat Feb 10 15:32:30 2024 +0100

tdf#156993 use correct count for ViewContactOfSdrPage

The count is used as upper limit in a for-loop in
ViewObjectContact::getPrimitive2DSequenceSubHierarchy().
That calls ViewContactOfSdrPage::GetViewContact().
With the wrong count the case 10 was not reached and thus the helplines
were not drawn.

Change-Id: If606bbb718b1f78a874862217d1e03b02287e848
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163192
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx 
b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index 05b045ec473a..c07bcffe762d 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -515,10 +515,10 @@ sal_uInt32 ViewContactOfSdrPage::GetObjectCount() const
 {
 // Fixed count of content. It contains PageBackground (Wiese), PageShadow, 
PageFill,
 // then - depending on if the page has a MasterPage - either MasterPage 
Hierarchy
-// or MPBGO. Also OuterPageBorder, InnerPageBorder and two pairs of Grid 
and Helplines
-// (for front and back) which internally are visible or not depending on 
the current
+// or MPBGO. Also OuterPageBorder, InnerPageBorder, PageHierarchy and two 
pairs of Grid and
+// Helplines (for front and back) which internally are visible or not 
depending on the current
 // front/back setting for those.
-return 10;
+return 11;
 }
 
 ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const


  1   2   3   4   5   6   7   8   9   10   >