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-19 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-19 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 = [_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);
-

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-04 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", 

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-02 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 = [_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-03 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 

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 = 

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"),
-

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();
-
-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();
 
-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() != nullptr)
-{
-SfxHintId nId(rHint.GetId());
 
-if(SfxHintId::DataChanged == nId)
+if(SfxHintId::DataChanged == nId && dynamic_cast() != 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() != 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() != 
nullptr)
+else if (nId == SfxHintId::StyleSheetModified && 
dynamic_cast() != nullptr)
 {
 const SfxStyleSheetModifiedHint* pExtendedHint = 
dynamic_cast();
-
-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();
 
-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();
+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 
, sdr::contact::DisplayInfo )
+{
+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 

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


core.git: svx/source

2024-02-08 Thread Oliver Specht (via logerrit)
 svx/source/dialog/cuicharmap.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit cbcf22eb8748d59857b29a8792377a10fc6c42b2
Author: Oliver Specht 
AuthorDate: Mon Feb 5 14:26:48 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Thu Feb 8 18:48:13 2024 +0100

tdf#159572 select font according to recent settings

selection of a recently inserted special character applies the
stored font to make sure the character is not inserted wit a
font that doesn't contain the symbol

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

diff --git a/svx/source/dialog/cuicharmap.cxx b/svx/source/dialog/cuicharmap.cxx
index 0d73c0d1b6dd..430bf250fdcd 100644
--- a/svx/source/dialog/cuicharmap.cxx
+++ b/svx/source/dialog/cuicharmap.cxx
@@ -523,6 +523,7 @@ IMPL_LINK(SvxCharacterMap, CharClickHdl, SvxCharView*, 
rView, void)
 {
 rView->GrabFocus();
 
+SetCharFont(rView->GetFont());
 m_aShowChar.SetText( rView->GetText() );
 m_aShowChar.SetFont(rView->GetFont());
 m_aShowChar.Invalidate();


core.git: svx/source

2024-02-08 Thread Mike Kaganski (via logerrit)
 svx/source/dialog/langbox.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 181f4c5ac9834c15fe0acc4b6e92f064e95ab32c
Author: Mike Kaganski 
AuthorDate: Thu Feb 8 12:34:59 2024 +0600
Commit: Mike Kaganski 
CommitDate: Thu Feb 8 09:31:46 2024 +0100

Try harder to use strict weak ordering when sorting

Special LanguageType referring to a system locale can resolve to some
language tag equal to another one, but they still compared inequal in
the check at the top of GenericFirst comparator, because only values
of LanguageType were compared. This could lead to a failed assertion
later, because both could then be ISO locales, and have no country.

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

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index f83cc956961e..e8b82e3ac63c 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)
-return false; // shortcut
+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
 
 // Make sure that e.g. generic 'Spanish {es}' goes before 'Spanish 
(Argentina)'.
 // We can't depend on MsLangId::getPrimaryLanguage/getSubLanguage, 
because e.g.


core.git: svx/source

2024-02-04 Thread Mike Kaganski (via logerrit)
 svx/source/svdraw/svdobj.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b0f9cb252d9dbb932a368a81871d0ba7c396dab8
Author: Mike Kaganski 
AuthorDate: Sun Feb 4 16:20:42 2024 +0600
Commit: Mike Kaganski 
CommitDate: Sun Feb 4 12:30:59 2024 +0100

Use constexpr instead of const

See commit bf2ae3c25a5da3a323c06fd5f949660ee64f0fa6 for rationale.

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

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 63844301ef1a..10dba8f0ebc7 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -758,7 +758,7 @@ void SdrObject::SetName(const OUString& rStr, const bool 
bSetChanged)
 
 const OUString & SdrObject::GetName() const
 {
-static const OUString EMPTY = u""_ustr;
+static constexpr OUString EMPTY = u""_ustr;
 
 if(m_pPlusData)
 {


core.git: svx/source

2024-02-03 Thread Mike Kaganski (via logerrit)
 svx/source/dialog/langbox.cxx |  106 --
 1 file changed, 81 insertions(+), 25 deletions(-)

New commits:
commit 6e540ab56e397d645b300d6cfbadc5c11a1e8151
Author: Mike Kaganski 
AuthorDate: Sat Feb 3 16:08:54 2024 +0600
Commit: Mike Kaganski 
CommitDate: Sun Feb 4 03:39:03 2024 +0100

Make sure to use strict weak ordering when sorting

See 
https://gerrit.libreoffice.org/c/core/+/152676/2#message-ea10fe33b46fee581d47c04d04291a59049d4ac3

The complexity of intended sort requires to split the languages by
language groups first, and use the "generic first" comparison only
inside groups.

As the result, e.g. Aranese and Occitan are grouped together.

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

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 713bf0d34b3f..f83cc956961e 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -28,12 +33,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -190,44 +197,93 @@ void SvxLanguageBox::AddLanguages(const std::vector< 
LanguageType >& rLanguageTy
 
 static void SortLanguages(std::vector& rEntries)
 {
-auto langLess = [](const weld::ComboBoxEntry& e1, const 
weld::ComboBoxEntry& e2)
+struct NaturalStringSorterCompare
+{
+bool operator()(const OUString& rLHS, const OUString& rRHS) const
+{
+static const auto aSorter = 
comphelper::string::NaturalStringSorter(
+comphelper::getProcessComponentContext(),
+Application::GetSettings().GetUILanguageTag().getLocale());
+return aSorter.compare(rLHS, rRHS) < 0;
+}
+};
+
+struct EntryData
+{
+LanguageTag tag;
+weld::ComboBoxEntry entry;
+};
+
+struct GenericFirst
 {
-if (e1.sId == e2.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.
-// for generic Bosnian {bs}, the MS-LCID is 0x781A, and getSubLanguage 
is not 0.
-// So we have to do the expensive LanguageTag construction.
-LanguageTag lt1(LanguageType(e1.sId.toInt32())), 
lt2(LanguageType(e2.sId.toInt32()));
-if (lt1.getLanguage() == lt2.getLanguage())
+bool operator()(const EntryData& e1, const EntryData& e2) const
 {
-const bool isLangOnly1 = lt1.isIsoLocale() && 
lt1.getCountry().isEmpty();
-const bool isLangOnly2 = lt2.isIsoLocale() && 
lt2.getCountry().isEmpty();
+assert(e1.tag.getLanguage() == e2.tag.getLanguage());
+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.
+// for generic Bosnian {bs}, the MS-LCID is 0x781A, and 
getSubLanguage is not 0.
+// So we have to do the expensive LanguageTag construction in 
EntryData.
+
+const bool isLangOnly1 = e1.tag.isIsoLocale() && 
e1.tag.getCountry().isEmpty();
+const bool isLangOnly2 = e2.tag.isIsoLocale() && 
e2.tag.getCountry().isEmpty();
+assert(!(isLangOnly1 && isLangOnly2));
 
 if (isLangOnly1)
 {
-// lt1 is a generic language-only tag
-if (!isLangOnly2)
-return true; // lt2 is not
+// e1.tag is a generic language-only tag, e2.tag is not
+return true;
 }
 else if (isLangOnly2)
 {
-// lt2 is a generic language-only tag, lt1 is not
+// e2.tag is a generic language-only tag, e1.tag is not
 return false;
 }
+
+// Do a normal string comparison for other cases
+return NaturalStringSorterCompare()(e1.entry.sString, 
e2.entry.sString);
 }
-// Do a normal string comparison for other cases
-static const auto aSorter = comphelper::string::NaturalStringSorter(
-comphelper::getProcessComponentContext(),
-Application::GetSettings().GetUILanguageTag().getLocale());
-return aSorter.compare(e1.sString, e2.sString) < 0;
 };
+using SortedLangEntries = o3tl::sorted_vector;
+
+// It is impossible to sort using only GenericFirst comparison: it would 

core.git: svx/source

2024-01-27 Thread Mike Kaganski (via logerrit)
 svx/source/form/formcontroller.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit db227dc7d032d642983c313ab74c34a301464c2a
Author: Mike Kaganski 
AuthorDate: Sat Jan 27 08:18:14 2024 +0100
Commit: Mike Kaganski 
CommitDate: Sat Jan 27 11:07:32 2024 +0100

Avoid incorrect overwrite the value

It would ignore the "enabled" state, if it its read-only is false

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

diff --git a/svx/source/form/formcontroller.cxx 
b/svx/source/form/formcontroller.cxx
index 0fb1bd64c942..e39367b98353 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -2125,7 +2125,7 @@ void FormController::setControlLock(const Reference< 
XControl > & xControl)
 bool bTouch = true;
 if (::comphelper::hasProperty(FM_PROP_ENABLED, xSet))
 bTouch = 
::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ENABLED));
-if (::comphelper::hasProperty(FM_PROP_READONLY, xSet))
+if (bTouch && ::comphelper::hasProperty(FM_PROP_READONLY, xSet))
 bTouch = 
!::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_READONLY));
 
 if (!bTouch)


core.git: svx/source

2024-01-26 Thread Caolán McNamara (via logerrit)
 svx/source/sdr/contact/objectcontactofpageview.cxx |4 ++--
 svx/source/tbxctrls/grafctrl.cxx   |4 ++--
 svx/source/tbxctrls/itemwin.cxx|4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2822b41dfcd26c6eb9f9ffa89672053663bb26f2
Author: Caolán McNamara 
AuthorDate: Fri Jan 26 14:05:12 2024 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 26 16:19:53 2024 +0100

just fetch SfxViewShell::Current() once, and as const

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

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx 
b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 89b6325cf492..79842eb761b0 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -219,8 +219,8 @@ namespace sdr::contact
 aNewViewInformation2D.setViewport(aViewRange);
 
aNewViewInformation2D.setVisualizedPage(GetXDrawPageForSdrPage(GetSdrPage()));
 aNewViewInformation2D.setViewTime(fCurrentTime);
-if (SfxViewShell::Current())
-
aNewViewInformation2D.setAutoColor(SfxViewShell::Current()->GetColorConfigColor(svtools::DOCCOLOR));
+if (const SfxViewShell* pViewShell = SfxViewShell::Current())
+
aNewViewInformation2D.setAutoColor(pViewShell->GetColorConfigColor(svtools::DOCCOLOR));
 updateViewInformation2D(aNewViewInformation2D);
 
 drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index b2daea684b87..6076c7548197 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -355,9 +355,9 @@ IMPL_LINK_NOARG(ImplGrafModeControl, FocusInHdl, 
weld::Widget&, void)
 
 void ImplGrafModeControl::ImplReleaseFocus()
 {
-if( SfxViewShell::Current() )
+if (const SfxViewShell* pViewShell = SfxViewShell::Current())
 {
-vcl::Window* pShellWnd = SfxViewShell::Current()->GetWindow();
+vcl::Window* pShellWnd = pViewShell->GetWindow();
 
 if( pShellWnd )
 pShellWnd->GrabFocus();
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 1a9b6d3bcf53..54004f3da511 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -114,9 +114,9 @@ IMPL_LINK_NOARG(SvxMetricField, ModifyHdl, 
weld::MetricSpinButton&, void)
 
 void SvxMetricField::ReleaseFocus_Impl()
 {
-if( SfxViewShell::Current() )
+if (const SfxViewShell* pViewShell = SfxViewShell::Current())
 {
-vcl::Window* pShellWnd = SfxViewShell::Current()->GetWindow();
+vcl::Window* pShellWnd = pViewShell->GetWindow();
 if ( pShellWnd )
 pShellWnd->GrabFocus();
 }


core.git: svx/source

2024-01-24 Thread Michael Weghorn (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 38f98c60e797753fa54bf3649520995df9861b45
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:34:58 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 

core.git: svx/source

2024-01-22 Thread AmosAidoo (via logerrit)
 svx/source/svdraw/svdfmtf.cxx |6 +++---
 svx/source/svdraw/svdfmtf.hxx |2 +-
 svx/source/svdraw/svdmark.cxx |4 ++--
 svx/source/svdraw/svdview.cxx |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit e3d03fa00d49c164ec235d77c827109eac522623
Author: AmosAidoo 
AuthorDate: Mon Jan 22 20:18:14 2024 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Tue Jan 23 08:04:55 2024 +0100

tdf#114441 convert sal_uLong to appropriate types

svdfmtf.cxx and .hxx
GetActionSize returns a size_t value
The parameter 'a' is compared to a size_t value

svdmark.cxx
GetOrdNum returns a sal_uInt32 value

svdview.cxx
GetLineCount returns a sal_uInt32 value

Change-Id: I85a0303742607208fdbfb7783e7254847720a2c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162416
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 923c40a550fa..0ea228dc4c28 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -114,9 +114,9 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(
 
 void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile const & rMtf, 
SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport)
 {
-const sal_uLong nCount(rMtf.GetActionSize());
+const size_t nCount = rMtf.GetActionSize();
 
-for(sal_uLong a(0); a < nCount; a++)
+for(size_t a = 0; a < nCount; a++)
 {
 MetaAction* pAct = rMtf.GetAction(a);
 
@@ -1219,7 +1219,7 @@ void ImpSdrGDIMetaFileImport::MapScaling()
 }
 
 
-void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, 
GDIMetaFile const & rMtf, sal_uLong& a) // GDIMetaFile* pMtf )
+void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, 
GDIMetaFile const & rMtf, size_t& a) // GDIMetaFile* pMtf )
 {
 bool aSkipComment = false;
 
diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx
index 31c325582799..6011293cfe92 100644
--- a/svx/source/svdraw/svdfmtf.hxx
+++ b/svx/source/svdraw/svdfmtf.hxx
@@ -121,7 +121,7 @@ class ImpSdrGDIMetaFileImport final
 
 // #i125211# The MetaCommentAction needs to advance (if used), thus
 // give current metafile and index which may be changed
-void DoAction(MetaCommentAction const & rAct, GDIMetaFile const & rMtf, 
sal_uLong& a);
+void DoAction(MetaCommentAction const & rAct, GDIMetaFile const & rMtf, 
size_t& a);
 
 // missing actions added
 void DoAction(MetaTextRectAction const & rAct);
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index c6151ccfd89d..fc5d815ab9a2 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -292,8 +292,8 @@ void SdrMarkList::InsertEntry(const SdrMark& rMark, bool 
bChkSort)
 
 if(pLastOL == pNewOL)
 {
-const sal_uLong nLastNum(pLastObj!=nullptr ? 
pLastObj->GetOrdNum() : 0);
-const sal_uLong nNewNum(pNewObj !=nullptr ? pNewObj 
->GetOrdNum() : 0);
+const sal_uInt32 nLastNum(pLastObj!=nullptr ? 
pLastObj->GetOrdNum() : 0);
+const sal_uInt32 nNewNum(pNewObj !=nullptr ? pNewObj 
->GetOrdNum() : 0);
 
 if(nNewNum < nLastNum)
 {
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index f88363268c69..c2a919924464 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1244,7 +1244,7 @@ OUString SdrView::GetStatusText()
 // At the end of a line of any multi-line paragraph, we display the
 // position of the next line of the same paragraph, if there is one.
 sal_uInt16 nParaLine = 0;
-sal_uLong nParaLineCount = 
mpTextEditOutliner->GetLineCount(aSel.nEndPara);
+sal_uInt32 nParaLineCount = 
mpTextEditOutliner->GetLineCount(aSel.nEndPara);
 bool bBrk = false;
 while (!bBrk)
 {


core.git: svx/source

2024-01-19 Thread AkshayWarrier (via logerrit)
 svx/source/dialog/ClassificationEditView.hxx |5 +
 svx/source/dialog/SafeModeDialog.hxx |5 +
 svx/source/dialog/contimp.hxx|6 +-
 svx/source/dialog/contwnd.hxx|6 +-
 svx/source/dialog/crashreportdlg.hxx |5 +
 5 files changed, 5 insertions(+), 22 deletions(-)

New commits:
commit 3f0dd3d635507e4505cab4dac6e493f9dc985c23
Author: AkshayWarrier 
AuthorDate: Fri Jan 19 16:25:15 2024 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Fri Jan 19 15:50:28 2024 +0100

tdf#143148 Use pragma once in svx

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

diff --git a/svx/source/dialog/ClassificationEditView.hxx 
b/svx/source/dialog/ClassificationEditView.hxx
index 225efe1243db..4e9a036a0989 100644
--- a/svx/source/dialog/ClassificationEditView.hxx
+++ b/svx/source/dialog/ClassificationEditView.hxx
@@ -8,8 +8,7 @@
  *
  */
 
-#ifndef INCLUDED_SVX_CLASSIFICATIONEDITVIEW_HXX
-#define INCLUDED_SVX_CLASSIFICATIONEDITVIEW_HXX
+#pragma once
 
 #include 
 #include 
@@ -49,6 +48,4 @@ public:
 
 } // end svx namespace
 
-#endif // INCLUDED_SVX_CLASSIFICATIONEDITVIEW_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/SafeModeDialog.hxx 
b/svx/source/dialog/SafeModeDialog.hxx
index dd7db077e084..1d4df62ff566 100644
--- a/svx/source/dialog/SafeModeDialog.hxx
+++ b/svx/source/dialog/SafeModeDialog.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SVX_SOURCE_DIALOG_SAFEMODEDIALOG_HXX
-#define INCLUDED_SVX_SOURCE_DIALOG_SAFEMODEDIALOG_HXX
+#pragma once
 
 #include 
 #include 
@@ -61,6 +60,4 @@ private:
 DECL_LINK(DialogBtnHdl, weld::Button&, void);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/contimp.hxx b/svx/source/dialog/contimp.hxx
index 2bf5aca4d1e8..268e64695249 100644
--- a/svx/source/dialog/contimp.hxx
+++ b/svx/source/dialog/contimp.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
-#define INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
+#pragma once
 
 #include 
 #include "contwnd.hxx"
@@ -126,7 +125,4 @@ public:
 void* pEditingObj );
 };
 
-
-#endif // INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/contwnd.hxx b/svx/source/dialog/contwnd.hxx
index 1bad623c05d6..a6b6efff1a7d 100644
--- a/svx/source/dialog/contwnd.hxx
+++ b/svx/source/dialog/contwnd.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SVX_SOURCE_DIALOG_CONTWND_HXX
-#define INCLUDED_SVX_SOURCE_DIALOG_CONTWND_HXX
+#pragma once
 
 #include 
 #include 
@@ -64,7 +63,4 @@ public:
 voidSetWorkplaceClickHdl( const Link& 
rLink ) { aWorkplaceClickLink = rLink; }
 };
 
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/crashreportdlg.hxx 
b/svx/source/dialog/crashreportdlg.hxx
index 3f2d9cb121c5..f7000e88557d 100644
--- a/svx/source/dialog/crashreportdlg.hxx
+++ b/svx/source/dialog/crashreportdlg.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SVX_SOURCE_DIALOG_CRASHREPORTDLG_HXX
-#define INCLUDED_SVX_SOURCE_DIALOG_CRASHREPORTDLG_HXX
+#pragma once
 
 #include 
 
@@ -37,6 +36,4 @@ private:
  vcl::ILibreOfficeKitNotifier*);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: svx/source

2024-01-18 Thread Michael Stahl (via logerrit)
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 1f540c49e68b28a360ee5c32d60ab1bed3837eec
Author: Michael Stahl 
AuthorDate: Thu Jan 18 13:04:35 2024 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 18 15:07:21 2024 +0100

tdf#158277 sw_redlinehide: fix find bar string

FindTextFieldControl::SetTextToSelected_Impl() uses the XModel to
retrieve the currently selected text, which naturally includes deleted
text.

Instead, use view API XTextViewCursor to get the visible selected text.

(regression from commit ae2232366f00e08c1855667cfaf068269ac9af2f)

Change-Id: I302ea90a7407af6e3ae7b62a2f373dccb33b8275
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162245
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 8e833167ea12..f8c4436443bc 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -243,12 +244,21 @@ void FindTextFieldControl::SetTextToSelected_Impl()
 try
 {
 css::uno::Reference 
xController(m_xFrame->getController(), css::uno::UNO_SET_THROW);
-css::uno::Reference 
xModel(xController->getModel(), css::uno::UNO_SET_THROW);
-css::uno::Reference 
xIndexAccess(xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW);
-if (xIndexAccess->getCount() > 0)
+uno::Reference const xTVCS(xController, 
uno::UNO_QUERY);
+if (xTVCS.is())
 {
-css::uno::Reference 
xTextRange(xIndexAccess->getByIndex(0), css::uno::UNO_QUERY_THROW);
-aString = xTextRange->getString();
+uno::Reference const 
xTVC(xTVCS->getViewCursor());
+aString = xTVC->getString();
+}
+else
+{
+uno::Reference xModel(xController->getModel(), 
uno::UNO_SET_THROW);
+uno::Reference 
xIndexAccess(xModel->getCurrentSelection(), uno::UNO_QUERY_THROW);
+if (xIndexAccess->getCount() > 0)
+{
+uno::Reference 
xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW);
+aString = xTextRange->getString();
+}
 }
 }
 catch ( ... )


core.git: svx/source

2024-01-04 Thread Heiko Tietze (via logerrit)
 svx/source/dialog/compressgraphicdialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a5a0bb0c6577c82f5e31f1a81e31381fdf6c0c2e
Author: Heiko Tietze 
AuthorDate: Thu Jan 4 12:13:44 2024 +0100
Commit: Heiko Tietze 
CommitDate: Thu Jan 4 14:00:21 2024 +0100

Resolves tdf#158780 - Enable "Reduce Resolution" by default

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

diff --git a/svx/source/dialog/compressgraphicdialog.cxx 
b/svx/source/dialog/compressgraphicdialog.cxx
index 8fcf479d889d..35899bec2f5f 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -45,7 +45,7 @@
 namespace
 {
 struct memParam {
-bool ReduceResolutionCB = false;
+bool ReduceResolutionCB = true;
 int  MFNewWidth = 1;
 int  MFNewHeight = 1;
 bool LosslessRB = true;


core.git: svx/source

2023-12-31 Thread Julien Nabet (via logerrit)
 svx/source/tbxctrls/SvxColorValueSet.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 327e9592319ddd192de01d1850e404a0918ad130
Author: Julien Nabet 
AuthorDate: Sun Dec 31 12:27:24 2023 +0100
Commit: Julien Nabet 
CommitDate: Sun Dec 31 16:27:00 2023 +0100

Replace "size() != 0 with !empty()" (svx)

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

diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx 
b/svx/source/tbxctrls/SvxColorValueSet.cxx
index 4a181730ed97..e72ab98598d6 100644
--- a/svx/source/tbxctrls/SvxColorValueSet.cxx
+++ b/svx/source/tbxctrls/SvxColorValueSet.cxx
@@ -72,7 +72,7 @@ void SvxColorValueSet::addEntriesForXColorList(const 
XColorList& rXColorList, sa
 void SvxColorValueSet::addEntriesForColorSet(const std::set& rColorSet, 
std::u16string_view rNamePrefix)
 {
 sal_uInt32 nStartIndex = 1;
-if(rNamePrefix.size() != 0)
+if(!rNamePrefix.empty())
 {
 for(const auto& rColor : rColorSet)
 {


core.git: svx/source

2023-12-28 Thread Julien Nabet (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 ++--
 svx/source/dialog/ClassificationDialog.cxx  |   10 +-
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx|4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b05e660b98d202876806353dff1eb0a5b53e8dec
Author: Julien Nabet 
AuthorDate: Thu Dec 28 14:38:17 2023 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 28 15:44:25 2023 +0100

Use emplace_back instead of push_back (svx)

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 2e19aa344ec4..a5f377912c6f 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -437,7 +437,7 @@ static void GetTextAreaOutline(
 aDXArry[a],
 aFont.GetFontHeight()
 )));
-
aCharacterData.vOutlines.push_back(tools::PolyPolygon(tools::Polygon(aPolygon)));
+
aCharacterData.vOutlines.emplace_back(tools::Polygon(aPolygon));
 }
 }
 else
@@ -450,7 +450,7 @@ static void GetTextAreaOutline(
 aDXArry.empty() ? 10 : aDXArry.back(),
 aFont.GetFontHeight()
 )));
-
aCharacterData.vOutlines.push_back(tools::PolyPolygon(tools::Polygon(aPolygon)));
+
aCharacterData.vOutlines.emplace_back(tools::Polygon(aPolygon));
 }
 
 
diff --git a/svx/source/dialog/ClassificationDialog.cxx 
b/svx/source/dialog/ClassificationDialog.cxx
index 03f38bb2f389..9c39e086edc3 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -357,7 +357,7 @@ void ClassificationDialog::readRecentlyUsed()
 }
 aWalker.parent();
 
-aResults.push_back({ eType, sString, 
sAbbreviatedString, sIdentifier });
+aResults.emplace_back(eType, sString, 
sAbbreviatedString, sIdentifier);
 }
 }
 aWalker.next();
@@ -541,7 +541,7 @@ std::vector 
ClassificationDialog::getResult()
 sWeightProperty = "BOLD";
 // Insert into collection
 OUString sBlank;
-aClassificationResults.push_back({ ClassificationType::PARAGRAPH, 
sWeightProperty, sBlank, sBlank });
+aClassificationResults.emplace_back(ClassificationType::PARAGRAPH, 
sWeightProperty, sBlank, sBlank);
 }
 
 const SvxFieldItem* pFieldItem = findField(rSection);
@@ -554,12 +554,12 @@ std::vector 
ClassificationDialog::getResult()
 
 if (pClassificationField)
 {
-aClassificationResults.push_back({ 
pClassificationField->meType, pClassificationField->msFullClassName,
-   
pClassificationField->msDescription, pClassificationField->msIdentifier });
+
aClassificationResults.emplace_back(pClassificationField->meType, 
pClassificationField->msFullClassName,
+   
pClassificationField->msDescription, pClassificationField->msIdentifier);
 }
 else
 {
-aClassificationResults.push_back({ ClassificationType::TEXT, 
sDisplayString, sDisplayString, OUString() });
+aClassificationResults.emplace_back(ClassificationType::TEXT, 
sDisplayString, sDisplayString, OUString());
 }
 }
 }
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 0994b4a38197..d0ed4839dcfb 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -849,9 +849,9 @@ sal_uInt32 
SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
 Primitive2DContainer aRetval;
 for (const auto& xChild : rContentForShadow)
 {
-aRetval.push_back(Primitive2DReference(
+aRetval.emplace_back(
 new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), 
rShadow.getBlur(),
-Primitive2DContainer({ xChild 
};
+Primitive2DContainer({ xChild })));
 if (rShadow.getTransparence() != 0.0)
 {
 Primitive2DContainer aTempContent{ aRetval.back() };


core.git: svx/source sw/source

2023-12-23 Thread Caolán McNamara (via logerrit)
 svx/source/form/datanavi.cxx|2 +-
 sw/source/uibase/shells/grfshex.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 25d4fae8d3f69dc4d03c1a04233e6ed670742ed5
Author: Caolán McNamara 
AuthorDate: Sat Dec 23 14:00:26 2023 +
Commit: Caolán McNamara 
CommitDate: Sat Dec 23 16:03:30 2023 +0100

cid#1546064 COPY_INSTEAD_OF_MOVE

and

cid#1546034 COPY_INSTEAD_OF_MOVE

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

diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 0178a82c5947..9116c0eb075f 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -306,7 +306,7 @@ namespace svxform
 
 // tdf#154535 create the OXFormsDescriptor on-demand so we don't cause 
an unwanted
 // Binding to be created unless we are forced to.
-auto fnCreateFormsDescriptor = [this, szName, xNode, xPropSet](){
+auto fnCreateFormsDescriptor = [this, szName=std::move(szName), 
xNode=std::move(xNode), xPropSet=std::move(xPropSet)](){
 OXFormsDescriptor desc;
 desc.szName = szName;
 if (xNode) {
diff --git a/sw/source/uibase/shells/grfshex.cxx 
b/sw/source/uibase/shells/grfshex.cxx
index 45d40764525b..a9af8799b009 100644
--- a/sw/source/uibase/shells/grfshex.cxx
+++ b/sw/source/uibase/shells/grfshex.cxx
@@ -80,7 +80,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq )
 css::uno::Reference 
xDispatchProvider(GetView().GetViewFrame().GetFrame().GetFrameInterface(), 
css::uno::UNO_QUERY);
 
 rtl::Reference xPlayerListener(new 
avmedia::PlayerListener(
-[xDispatchProvider, aURL, bLink](const 
css::uno::Reference& rPlayer){
+[xDispatchProvider=std::move(xDispatchProvider), aURL, 
bLink](const css::uno::Reference& rPlayer){
 css::awt::Size aSize = 
rPlayer->getPreferredPlayerWindowSize();
 
avmedia::MediaWindow::dispatchInsertAVMedia(xDispatchProvider, aSize, aURL, 
bLink);
 }));


core.git: svx/source

2023-12-23 Thread Armin Le Grand (allotropia) (via logerrit)
 svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 1582bde861ad8e556fcf06657e7228980ff284e9
Author: Armin Le Grand (allotropia) 
AuthorDate: Fri Dec 22 17:20:21 2023 +0100
Commit: Armin Le Grand 
CommitDate: Sat Dec 23 15:49:08 2023 +0100

Add flush mechanism to buffered Primitives III

There seem to be problems with re-creation of
SdrCustomShapePrimitive2D primitive presentation
due to SdrText not being held as
uno::Reference everywhere. For now,
try if excluding SdrCustomShapePrimitive2D from
being flushed helps - may give hints already...

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

diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx 
b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index b58274106211..19717e2eb121 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -102,8 +102,6 @@ namespace drawinglayer::primitive2d
 mb3DShape(b3DShape),
 maTransform(std::move(aTransform))
 {
-// activate callback to flush buffered decomposition content
-setCallbackSeconds(10);
 }
 
 bool SdrCustomShapePrimitive2D::operator==(const BasePrimitive2D& 
rPrimitive) const


core.git: svx/source

2023-12-12 Thread Noel Grandin (via logerrit)
 svx/source/dialog/framelinkarray.cxx |   26 +++---
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit f625928c346109216045d08b4dda30dbada005f5
Author: Noel Grandin 
AuthorDate: Tue Dec 12 15:23:16 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 13 08:27:14 2023 +0100

tdf#158636 Wrong border behaviour when cells are merged

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

where I accidentally removed a line in lclSetMergedRange that
set mbMergedOrg to true.

And then the singlevalfields plugin spotted that
mbMergedOrig had only value, and so it got removed in:
commit 884a2cd39a7c0433a5bbbf4e83e2a9b16cdad71c
Author: Noel Grandin 
Date:   Fri Jun 30 15:36:51 2023 +0200
loplugin:singlevalfields

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

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 21afef6441f5..fa5829438698 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -64,6 +64,7 @@ public:
 SvxRotateMode   meRotMode;
 double  mfOrientation;
 
+boolmbMergeOrig;
 boolmbOverlapX;
 boolmbOverlapY;
 
@@ -88,7 +89,7 @@ public:
 const Style& GetStyleTLBR() const { return maTLBR; }
 const Style& GetStyleBLTR() const { return maBLTR; }
 
-boolIsMerged() const { return mbOverlapX || mbOverlapY; }
+boolIsMerged() const { return mbMergeOrig || mbOverlapX || 
mbOverlapY; }
 boolIsRotated() const { return mfOrientation != 0.0; }
 
 voidMirrorSelfX();
@@ -206,6 +207,7 @@ Cell::Cell() :
 mnAddBottom( 0 ),
 meRotMode(SvxRotateMode::SVX_ROTATE_MODE_STANDARD ),
 mfOrientation( 0.0 ),
+mbMergeOrig( false ),
 mbOverlapX( false ),
 mbOverlapY( false )
 {
@@ -229,6 +231,7 @@ bool Cell::operator==(const Cell& rOther) const
 && mnAddBottom == rOther.mnAddBottom
 && meRotMode == rOther.meRotMode
 && mfOrientation == rOther.mfOrientation
+&& mbMergeOrig == rOther.mbMergeOrig
 && mbOverlapX == rOther.mbOverlapX
 && mbOverlapY == rOther.mbOverlapY;
 }
@@ -248,6 +251,7 @@ size_t Cell::hashCode() const
 o3tl::hash_combine(seed, mnAddBottom);
 o3tl::hash_combine(seed, meRotMode);
 o3tl::hash_combine(seed, mfOrientation);
+o3tl::hash_combine(seed, mbMergeOrig);
 o3tl::hash_combine(seed, mbOverlapX);
 o3tl::hash_combine(seed, mbOverlapY);
 return seed;
@@ -352,7 +356,7 @@ struct ArrayImpl
 
 boolHasCellRotation() const;
 
-Cell* createOrFind(const Cell& rCell);
+const Cell* createOrFind(const Cell& rCell);
 };
 
 static void lclSetMergedRange( ArrayImpl& rImpl, CellVec& rCells, sal_Int32 
nWidth, sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 
nLastRow )
@@ -363,12 +367,14 @@ static void lclSetMergedRange( ArrayImpl& rImpl, CellVec& 
rCells, sal_Int32 nWid
 {
 const Cell* pCell = rCells[ nRow * nWidth + nCol ];
 Cell aTempCell(*pCell);
+aTempCell.mbMergeOrig = false;
 aTempCell.mbOverlapX = nCol > nFirstCol;
 aTempCell.mbOverlapY = nRow > nFirstRow;
 rCells[ nRow * nWidth + nCol ] = rImpl.createOrFind(aTempCell);
 }
 }
 Cell aTempCell(*rCells[ nFirstRow * nWidth + nFirstCol ]);
+aTempCell.mbMergeOrig = true;
 rCells[ nFirstRow * nWidth + nFirstCol ] = rImpl.createOrFind(aTempCell);
 }
 
@@ -399,7 +405,7 @@ ArrayImpl::~ArrayImpl()
 delete pCell;
 }
 
-Cell* ArrayImpl::createOrFind(const Cell& rCell)
+const Cell* ArrayImpl::createOrFind(const Cell& rCell)
 {
 auto it = maRegisteredCells.find(const_cast());
 if (it != maRegisteredCells.end())
@@ -1142,6 +1148,20 @@ void Array::MirrorSelfX()
 aNewCells.push_back( mxImpl->createOrFind(aTempCell) );
 }
 }
+for( nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
+{
+for( nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
+{
+if( mxImpl->GetCell( nCol, nRow )->mbMergeOrig )
+{
+sal_Int32 nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
+sal_Int32 nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
+lclSetMergedRange( *mxImpl, aNewCells, mxImpl->mnWidth,
+mxImpl->GetMirrorCol( nLastCol ), nRow,
+mxImpl->GetMirrorCol( nCol ), nLastRow );
+}
+}
+}
 mxImpl->maCells.swap( aNewCells );
 

core.git: svx/source

2023-12-11 Thread Balazs Varga (via logerrit)
 svx/source/dialog/optgrid.cxx |   37 ++---
 1 file changed, 30 insertions(+), 7 deletions(-)

New commits:
commit 7d5c403f3759b14fe3be206f4c29494799eac2b4
Author: Balazs Varga 
AuthorDate: Mon Dec 11 10:33:20 2023 +0100
Commit: Balazs Varga 
CommitDate: Mon Dec 11 15:58:11 2023 +0100

tdf#158473 - UI: Part 55 - Unify lockdown behavior of Options dialog

for Calc - Grid Page.

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

diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 2226eaa4e23c..6cee157cc005 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -261,7 +262,8 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 case HTML_MODE: bReadOnly = 
officecfg::Office::WriterWeb::Grid::Option::SnapToGrid::isReadOnly(); break;
 case IMPRESS_MODE: bReadOnly = 
officecfg::Office::Impress::Grid::Option::SnapToGrid::isReadOnly(); break;
 case DRAW_MODE: bReadOnly = 
officecfg::Office::Draw::Grid::Option::SnapToGrid::isReadOnly(); break;
-default: //TODO Calc
+case CALC_MODE: bReadOnly = 
officecfg::Office::Calc::Grid::Option::SnapToGrid::isReadOnly(); break;
+default:
 break;
 }
 m_xCbxUseGridsnap->set_active(pGridAttr->bUseGridsnap);
@@ -274,7 +276,8 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 case HTML_MODE: bReadOnly = 
officecfg::Office::WriterWeb::Grid::Option::Synchronize::isReadOnly(); break;
 case IMPRESS_MODE: bReadOnly = 
officecfg::Office::Impress::Grid::Option::Synchronize::isReadOnly(); break;
 case DRAW_MODE: bReadOnly = 
officecfg::Office::Draw::Grid::Option::Synchronize::isReadOnly(); break;
-default: //TODO Calc
+case CALC_MODE: bReadOnly = 
officecfg::Office::Calc::Grid::Option::Synchronize::isReadOnly(); break;
+default:
 break;
 }
 m_xCbxSynchronize->set_active(pGridAttr->bSynchronize);
@@ -287,7 +290,8 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 case HTML_MODE: bReadOnly = 
officecfg::Office::WriterWeb::Grid::Option::VisibleGrid::isReadOnly(); break;
 case IMPRESS_MODE: bReadOnly = 
officecfg::Office::Impress::Grid::Option::VisibleGrid::isReadOnly(); break;
 case DRAW_MODE: bReadOnly = 
officecfg::Office::Draw::Grid::Option::VisibleGrid::isReadOnly(); break;
-default: //TODO Calc
+case CALC_MODE: bReadOnly = 
officecfg::Office::Calc::Grid::Option::VisibleGrid::isReadOnly(); break;
+default:
 break;
 }
 m_xCbxGridVisible->set_active(pGridAttr->bGridVisible);
@@ -318,7 +322,15 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 bReadOnly = 
officecfg::Office::Draw::Grid::Resolution::XAxis::NonMetric::isReadOnly();
 }
 break;
-default: //TODO Calc
+case CALC_MODE:
+{
+if (lcl_IsMetricSystem())
+bReadOnly = 
officecfg::Office::Calc::Grid::Resolution::XAxis::Metric::isReadOnly();
+else
+bReadOnly = 
officecfg::Office::Calc::Grid::Resolution::XAxis::NonMetric::isReadOnly();
+}
+break;
+default:
 break;
 }
 m_xMtrFldDrawX->set_sensitive(!bReadOnly);
@@ -344,7 +356,15 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 bReadOnly = 
officecfg::Office::Draw::Grid::Resolution::YAxis::NonMetric::isReadOnly();
 }
 break;
-default: //TODO Calc
+case CALC_MODE:
+{
+if (lcl_IsMetricSystem())
+bReadOnly = 
officecfg::Office::Calc::Grid::Resolution::YAxis::Metric::isReadOnly();
+else
+bReadOnly = 
officecfg::Office::Calc::Grid::Resolution::YAxis::NonMetric::isReadOnly();
+}
+break;
+default:
 break;
 }
 m_xMtrFldDrawY->set_sensitive(!bReadOnly);
@@ -359,7 +379,8 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 case HTML_MODE: bReadOnly = 
officecfg::Office::WriterWeb::Grid::Subdivision::XAxis::isReadOnly(); break;
 case IMPRESS_MODE: bReadOnly = 
officecfg::Office::Impress::Grid::Subdivision::XAxis::isReadOnly(); break;
 case DRAW_MODE: bReadOnly = 
officecfg::Office::Draw::Grid::Subdivision::XAxis::isReadOnly(); break;
-default: //TODO Calc
+case CALC_MODE: bReadOnly = 
officecfg::Office::Calc::Grid::Subdivision::XAxis::isReadOnly(); 

core.git: svx/source sw/source

2023-12-09 Thread Caolán McNamara (via logerrit)
 svx/source/form/fmshimp.cxx|2 +-
 sw/source/core/layout/paintfrm.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit cf3dda7c1c1da50db75d4c022bef279149d26636
Author: Caolán McNamara 
AuthorDate: Sat Dec 9 19:28:18 2023 +
Commit: Caolán McNamara 
CommitDate: Sat Dec 9 21:59:57 2023 +0100

cid#1546275 Using invalid iterator

and

cid#1545870 Using invalid iterator

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

diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index d54c5acaebde..890394856688 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3372,7 +3372,7 @@ void FmXFormShell::CreateExternalView_Lock()
 
 // list source
 MapUString2UstringSeq::const_iterator aCurrentListSource = 
aRadioListSources.find(rCtrlSource.first);
-DBG_ASSERT(aCurrentListSource != aRadioListSources.end(),
+assert(aCurrentListSource != aRadioListSources.end() &&
 "FmXFormShell::CreateExternalView : inconsistent radio 
descriptions !");
 pListBoxDescription->Name = FM_PROP_LISTSOURCE;
 pListBoxDescription->Value <<= (*aCurrentListSource).second;
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 0f048c4e805d..8ca5e35d1c84 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2746,8 +2746,8 @@ void SwTabFramePainter::FindStylesForLine( Point& 
rStartPoint,
 }
 
 aMapIter = maHoriLines.find( rStartPoint.Y() );
-OSL_ENSURE( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" );
-const SwLineEntrySet& rHoriSet = (*aMapIter).second;
+assert(aMapIter != maHoriLines.end() && "FindStylesForLine: Error");
+const SwLineEntrySet& rHoriSet = aMapIter->second;
 
 for ( const SwLineEntry& rEntry : rHoriSet )
 {


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

2023-12-04 Thread Julien Nabet (via logerrit)
 svx/source/form/fmshimp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6bc0020108e8b45954727276ba11b462feb9a4bf
Author: Julien Nabet 
AuthorDate: Mon Dec 4 18:23:32 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Dec 4 20:28:02 2023 +0100

Put back the message in assert after 
b50da6f3a9109fc1d4468c15aa7d5c68773ec199

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

diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index a71f78f2296b..5dce31f180ba 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3380,7 +3380,7 @@ void FmXFormShell::CreateExternalView_Lock()
 
 // value list
 MapUString2UstringSeq::const_iterator aCurrentValueList = 
aRadioValueLists.find(rCtrlSource.first);
-assert(aCurrentValueList != aRadioValueLists.end());
+assert(aCurrentValueList != aRadioValueLists.end() && 
"FmXFormShell::CreateExternalView : inconsistent radio descriptions !");
 pListBoxDescription->Name = FM_PROP_STRINGITEMLIST;
 pListBoxDescription->Value <<= (*aCurrentValueList).second;
 ++pListBoxDescription;


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

2023-11-30 Thread Heiko Tietze (via logerrit)
 svx/source/form/labelitemwindow.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 48ba98a51f029cd14b5d982dab36eb581d40fef3
Author: Heiko Tietze 
AuthorDate: Wed Nov 29 14:29:57 2023 +0100
Commit: Heiko Tietze 
CommitDate: Thu Nov 30 11:41:38 2023 +0100

Resolves tdf#158412 - Don't show chevron in quick find bar

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

diff --git a/svx/source/form/labelitemwindow.cxx 
b/svx/source/form/labelitemwindow.cxx
index 1ccbe6c5d156..c9afd1534acc 100644
--- a/svx/source/form/labelitemwindow.cxx
+++ b/svx/source/form/labelitemwindow.cxx
@@ -50,7 +50,8 @@ void LabelItemWindow::set_label(const OUString& rLabel, const 
LabelItemWindowTyp
 m_xLabel->set_font_color(Color(0x00, 0x47, 0x85));
 m_xBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
 }
-m_xLabel->set_visible(!rLabel.isEmpty());
+m_xLabel->set_visible(
+true); // always show and not just if !rLabel.isEmpty() to not make 
the chevron appear
 }
 
 OUString LabelItemWindow::get_label() const { return m_xLabel->get_label(); }


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

2023-11-29 Thread Andrea Gelmini (via logerrit)
 svx/source/dialog/optgrid.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 15ea67e549507f71b4367b7709339e61ba780c92
Author: Andrea Gelmini 
AuthorDate: Wed Nov 29 14:29:08 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 29 16:49:46 2023 +0100

Remove duplicated include

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

diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 59bc67b2e26a..c0e6f6ebe03b 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


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

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

New commits:
commit 2b62b4021fb91e4f18a0b8eceace52046948a74e
Author: Caolán McNamara 
AuthorDate: Tue Nov 28 09:23:07 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 29 09:38:00 2023 +0100

cid#136 Use of auto that causes a copy

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

diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 21998ff4e339..eeaa5571576b 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1727,7 +1727,7 @@ SdrGluePoint 
SdrObjCustomShape::GetVertexGluePoint(sal_uInt16 nPosNum) const
 }
 
 Point aPt;
-auto aRectangle = getRectangle();
+tools::Rectangle aRectangle = getRectangle();
 switch (nPosNum)
 {
 case 0: aPt = aRectangle.TopCenter();aPt.AdjustY( -nWdt ); break;


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

2023-11-28 Thread Noel Grandin (via logerrit)
 svx/source/dialog/_bmpmask.cxx|5 +
 vcl/source/graphic/GraphicObject2.cxx |2 +-
 vcl/source/rendercontext/drawmode.cxx |2 +-
 vcl/workben/vcldemo.cxx   |3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit f4edd6258dff38c45e4a6b709e4e1d72a55a446c
Author: Noel Grandin 
AuthorDate: Tue Nov 28 12:43:25 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 28 19:55:51 2023 +0100

simplify some BitmapEx constructions

using the color bitmap __and__ the alpha from another BitmapEx
is equivalent to just doing a straight copy/assign

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

diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 1db7e661cdd7..3e6a56a79f91 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -994,10 +994,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic )
 if ( aBitmapEx.GetSizePixel().Width() && 
aBitmapEx.GetSizePixel().Height() )
 {
 ImpMask( aBitmapEx );
-if ( aGraphic.IsTransparent() )
-aGraphic = Graphic( BitmapEx( 
aBitmapEx.GetBitmap(), aBitmapEx.GetAlphaMask() ) );
-else
-aGraphic = aBitmapEx;
+aGraphic = Graphic( aBitmapEx );
 }
 }
 }
diff --git a/vcl/source/graphic/GraphicObject2.cxx 
b/vcl/source/graphic/GraphicObject2.cxx
index 02a9374759bf..2f60e315d5ef 100644
--- a/vcl/source/graphic/GraphicObject2.cxx
+++ b/vcl/source/graphic/GraphicObject2.cxx
@@ -457,7 +457,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx&  
rBmpEx,
 
 if( rBmpEx.IsAlpha() )
 {
-aBmpEx2 = BitmapEx( rBmpEx.GetBitmap(), rBmpEx.GetAlphaMask() 
);
+aBmpEx2 = rBmpEx;
 }
 else
 {
diff --git a/vcl/source/rendercontext/drawmode.cxx 
b/vcl/source/rendercontext/drawmode.cxx
index ab3b36e0223d..fd3f29ac275f 100644
--- a/vcl/source/rendercontext/drawmode.cxx
+++ b/vcl/source/rendercontext/drawmode.cxx
@@ -269,7 +269,7 @@ BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, 
DrawModeFlags nDrawMode)
 }
 else
 {
-aBmpEx = BitmapEx(aColorBmp, aBmpEx.GetAlphaMask());
+aBmpEx = BitmapEx(aColorBmp);
 }
 }
 
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 346de0b52a09..1214a61a9406 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1406,8 +1406,7 @@ public:
 rDev.DrawBitmap(aBelow, aGrey);
 
 aBelow.Move(aGrey.GetSizePixel().Width(),0);
-BitmapEx aGreyMask(aSrc.GetBitmap(),
-   aSrc.GetAlphaMask());
+BitmapEx aGreyMask(aSrc);
 rDev.DrawBitmapEx(aBelow, aGreyMask);
 
 aLocation.Move(aSrc.GetSizePixel().Width()*6,0);


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

2023-11-28 Thread Heiko Tietze (via logerrit)
 svx/source/dialog/srchdlg.cxx|1 +
 svx/source/form/labelitemwindow.cxx  |1 +
 svx/uiconfig/ui/findreplacedialog.ui |   11 ++-
 svx/uiconfig/ui/labelbox.ui  |2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 5a622f1a29d249a512cc24f99d189f748623c678
Author: Heiko Tietze 
AuthorDate: Tue Nov 28 11:10:58 2023 +0100
Commit: Heiko Tietze 
CommitDate: Tue Nov 28 14:33:18 2023 +0100

Related tdf#156227 - Find/quickfind design

Themed icons look bad when drawn white on light blue;
using the same icon as on the infobar makes more sense

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

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index b5cf7bcf34fd..b1c87a6db7c8 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -344,6 +344,7 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 
 m_xSearchLabel->set_font_color(Color(0x00, 0x47, 0x85));
 this->SetSearchLabel(""); // hide the message but keep the box height
+m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - 
too large here
 
 m_xReplaceTmplLB->make_sorted();
 m_xReplaceAttrText->hide();
diff --git a/svx/source/form/labelitemwindow.cxx 
b/svx/source/form/labelitemwindow.cxx
index bdff03e060f2..1ccbe6c5d156 100644
--- a/svx/source/form/labelitemwindow.cxx
+++ b/svx/source/form/labelitemwindow.cxx
@@ -19,6 +19,7 @@ LabelItemWindow::LabelItemWindow(vcl::Window* pParent, const 
OUString& rLabel)
 
 m_xLabel->set_label(rLabel);
 m_xImage->hide();
+m_xImage->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - too 
large here
 
 SetOptimalSize();
 
diff --git a/svx/uiconfig/ui/findreplacedialog.ui 
b/svx/uiconfig/ui/findreplacedialog.ui
index 57a16e666a2f..e915a647f710 100644
--- a/svx/uiconfig/ui/findreplacedialog.ui
+++ b/svx/uiconfig/ui/findreplacedialog.ui
@@ -290,15 +290,16 @@
   
 True
 False
+center
 6
 3
 3
 3
-res/info.png
+vcl/res/infobox.png
 
-
-Search icon
-
+  
+Search icon
+  
 
   
   
@@ -323,7 +324,7 @@
 0
 
   
-  notification
+notification
   
 
   
diff --git a/svx/uiconfig/ui/labelbox.ui b/svx/uiconfig/ui/labelbox.ui
index f77cd5da7f4e..29210661b91c 100644
--- a/svx/uiconfig/ui/labelbox.ui
+++ b/svx/uiconfig/ui/labelbox.ui
@@ -15,7 +15,7 @@
 6
 3
 3
-res/info.png
+vcl/res/infobox.png
   
   
 False


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

2023-11-23 Thread Noel Grandin (via logerrit)
 svx/source/dialog/framelinkarray.cxx |  207 +--
 1 file changed, 104 insertions(+), 103 deletions(-)

New commits:
commit ac424db10e963864bc5744897561e0bf127a615c
Author: Noel Grandin 
AuthorDate: Thu Nov 23 09:28:46 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 23 10:37:23 2023 +0100

re-apply "Work with what we have in ArrayImpl: pointers"

re-apply commit f7df46c917533d3ce3528d52f49629fe9f51e67b "Work with what
we have in ArrayImpl: pointers", which I somehow managed to revert while
preparing commit d9c726beb64968e84d2150824c81dcf0a8b66ec2 "optimise
framelinkarray lookup"

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

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 3431c861fcfd..21afef6441f5 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -228,6 +228,7 @@ bool Cell::operator==(const Cell& rOther) const
 && mnAddTop == rOther.mnAddTop
 && mnAddBottom == rOther.mnAddBottom
 && meRotMode == rOther.meRotMode
+&& mfOrientation == rOther.mfOrientation
 && mbOverlapX == rOther.mbOverlapX
 && mbOverlapY == rOther.mbOverlapY;
 }
@@ -246,6 +247,7 @@ size_t Cell::hashCode() const
 o3tl::hash_combine(seed, mnAddTop);
 o3tl::hash_combine(seed, mnAddBottom);
 o3tl::hash_combine(seed, meRotMode);
+o3tl::hash_combine(seed, mfOrientation);
 o3tl::hash_combine(seed, mbOverlapX);
 o3tl::hash_combine(seed, mbOverlapY);
 return seed;
@@ -321,7 +323,7 @@ struct ArrayImpl
 sal_Int32   GetIndex( sal_Int32 nCol, sal_Int32 nRow ) const
 { return nRow * mnWidth + nCol; }
 
-const Cell& GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
+const Cell* GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
 voidPutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell& );
 
 sal_Int32  GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) 
const;
@@ -329,8 +331,8 @@ struct ArrayImpl
 sal_Int32  GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 sal_Int32  GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 
-const Cell& GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
-const Cell& GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
+const Cell* GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
+const Cell* GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 
 boolIsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow 
) const;
 boolIsMergedOverlappedRight( sal_Int32 nCol, sal_Int32 
nRow ) const;
@@ -408,9 +410,9 @@ Cell* ArrayImpl::createOrFind(const Cell& rCell)
 return pRetval;
 }
 
-const Cell& ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const
+const Cell* ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const
 {
-return IsValidPos( nCol, nRow ) ? *maCells[ GetIndex( nCol, nRow ) ] : 
OBJ_CELL_NONE;
+return IsValidPos( nCol, nRow ) ? maCells[ GetIndex( nCol, nRow ) ] : 
_CELL_NONE;
 }
 
 void ArrayImpl::PutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell & rCell )
@@ -422,61 +424,61 @@ void ArrayImpl::PutCell( sal_Int32 nCol, sal_Int32 nRow, 
const Cell & rCell )
 sal_Int32 ArrayImpl::GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nFirstCol = nCol;
-while( (nFirstCol > 0) && GetCell( nFirstCol, nRow ).mbOverlapX ) 
--nFirstCol;
+while( (nFirstCol > 0) && GetCell( nFirstCol, nRow )->mbOverlapX ) 
--nFirstCol;
 return nFirstCol;
 }
 
 sal_Int32 ArrayImpl::GetMergedFirstRow( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nFirstRow = nRow;
-while( (nFirstRow > 0) && GetCell( nCol, nFirstRow ).mbOverlapY ) 
--nFirstRow;
+while( (nFirstRow > 0) && GetCell( nCol, nFirstRow )->mbOverlapY ) 
--nFirstRow;
 return nFirstRow;
 }
 
 sal_Int32 ArrayImpl::GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nLastCol = nCol + 1;
-while( (nLastCol < mnWidth) && GetCell( nLastCol, nRow ).mbOverlapX ) 
++nLastCol;
+while( (nLastCol < mnWidth) && GetCell( nLastCol, nRow )->mbOverlapX ) 
++nLastCol;
 return nLastCol - 1;
 }
 
 sal_Int32 ArrayImpl::GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 sal_Int32 nLastRow = nRow + 1;
-while( (nLastRow < mnHeight) && GetCell( nCol, nLastRow ).mbOverlapY ) 
++nLastRow;
+while( (nLastRow < mnHeight) && GetCell( nCol, nLastRow )->mbOverlapY ) 
++nLastRow;
 return nLastRow - 1;
 }
 
-const Cell& ArrayImpl::GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) 
const
+const Cell* ArrayImpl::GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow 

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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f17b89b9e4d1e5c1cf608a2ce1ed218917e3447b
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:16:49 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:04:58 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 2d86e99073c2..2e19aa344ec4 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -832,8 +832,8 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 sal_uInt16 i;
 for (i = 0; i < nPointCount; i++)
 {
-//Normal vector for a point will be calculated 
from its neightbour points
-//except if is in the start/end of the vector
+//Normal vector for a point will be calculated 
from its neighbour points
+//except if it is in the start/end of the vector
 sal_uInt16 nPointIdx1 = i == 0 ? i : i - 1;
 sal_uInt16 nPointIdx2 = i == nPointCount - 1 ? i : 
i + 1;
 


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8b6e497a3a9c0d3ce054d3516a2646576a5c8247
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:20:36 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:03:10 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index ff6903d1f181..a51e93588582 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -828,7 +828,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 vCurOutline.reserve(nPointCount);
 vNorm.reserve(nPointCount);
 
-// Calculate Normal vectors, and allocate curve datas
+// Calculate Normal vectors, and allocate curve data
 sal_uInt16 i;
 for (i = 0; i < nPointCount; i++)
 {


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d2cfc1cbcb70954951a7bd95a95da26233552733
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:15:08 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:02:50 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 8a2984cbdd10..ff6903d1f181 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -930,7 +930,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 
 // if fAdjust<0, then it means, the text 
was longer, as
 // the current outline, so we will skip 
the text scaling, and
-// the text horizontal alignment ajustment
+// the text horizontal alignment adjustment
 // so the text will be rendered just as 
long as the cureve is.
 if (fAdjust >= 0)
 {


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ac2839458c5f497b907506da07dcd1b451b62372
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:16:24 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:02:11 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 733483e4a75e..8a2984cbdd10 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -903,7 +903,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 = nAdjust * (fCurWidth - 
rParagraph.aBoundRect.GetWidth()) / 2;
 }
 else
-fAdjust = -1;   // we neet tho shrink the text 
to fit the curve
+fAdjust = -1;   // we need to shrink the text 
to fit the curve
 
 for ( auto& rCharacter : rParagraph.vCharacters )
 {


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 99ef89ba4cd2497f3a46448692a71d98c721ae9e
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:15:56 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:01:54 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index ba7b2890f905..733483e4a75e 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -784,7 +784,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 
 if ( !vDistances.empty() )
 {
-// horizontal aligment: how much we have to move text to 
the right.
+// horizontal alignment: how much we have to move text to 
the right.
 int nAdjust = -1;
 switch (eHorzAdjust)
 {


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c49d688d212fd89daee5563b67b55f687f6d901a
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:16:06 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:01:01 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 47d2c0830e3f..0bbf501835aa 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -867,7 +867,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 double fCurvesDist = 
rTextArea.aBoundRect.GetHeight() / 2.0
  + rTextArea.aBoundRect.Top()
  - 
rParagraph.aBoundRect.Center().Y();
-// verical alignment adjust
+// vertical alignment adjust
 fCurvesDist -= rTextArea.nHAlignMove;
 
 for (i = 0; i < nPointCount; i++)


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

2023-11-22 Thread Andrea Gelmini (via logerrit)
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84d8a1caf124a25fb081562e4db32acf19e0f301
Author: Andrea Gelmini 
AuthorDate: Wed Nov 22 16:15:24 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 22 21:00:37 2023 +0100

Fix typo

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

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx 
b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 8f2896109e9e..47d2c0830e3f 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -939,7 +939,7 @@ static void FitTextOutlinesToShapeOutlines(const 
tools::PolyPolygon& aOutlines2d
 }
 // 0 <= fM1,fM2 <= 1 should be true, but 
rounding errors can
 // make a small mistake.
-// make sure they are >0 becuase 
GetPoint() need that
+// make sure they are >0 because 
GetPoint() need that
 if (fM1 < 0) fM1 = 0;
 if (fM2 < 0) fM2 = 0;
 


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

2023-11-10 Thread Armin Le Grand (allotropia) (via logerrit)
 svx/source/accessibility/ChildrenManagerImpl.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 23e9a4cf1eec75cdd40a695ecae2af9b952178d3
Author: Armin Le Grand (allotropia) 
AuthorDate: Fri Nov 10 17:59:11 2023 +0100
Commit: Armin Le Grand 
CommitDate: Fri Nov 10 20:05:11 2023 +0100

tdf#158169 take no actions in disposed incarnation

Using the described steps in the bug report it is possible
to have an already disposed incarnation of ChildrenManagerImpl
that gets called with notifyEvent. If exposed it is necessary
not to execute actions, but to inform the caller by triggering
a lang::DisposedException(). The SfxBaseModel::notifyEvent
that executes this will then remove the instance from it's list.

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

diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx 
b/svx/source/accessibility/ChildrenManagerImpl.cxx
index 96e27c079e9b..5271f1887b83 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -681,6 +681,11 @@ void SAL_CALL
 ChildrenManagerImpl::notifyEvent (
 const document::EventObject& rEventObject)
 {
+// tdf#158169 if we are already disposed, execute no actions, but inform 
the
+// caller that we are disposed
+if ( m_bDisposed )
+throw lang::DisposedException();
+
 if (rEventObject.EventName == "ShapeInserted")
 AddShape (Reference(rEventObject.Source, 
uno::UNO_QUERY));
 else if (rEventObject.EventName == "ShapeRemoved")


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

2023-11-05 Thread Thorsten Behrens (via logerrit)
 svx/source/gallery2/galleryfilestorage.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1d939b782235a62c965a4c8309869796b5838acf
Author: Thorsten Behrens 
AuthorDate: Sun Nov 5 01:26:46 2023 +0100
Commit: Thorsten Behrens 
CommitDate: Sun Nov 5 21:21:27 2023 +0100

reprobuild: don't write nondeterministic textencoding

No need to write this legacy int16, that we ignore on read anyway.

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

diff --git a/svx/source/gallery2/galleryfilestorage.cxx 
b/svx/source/gallery2/galleryfilestorage.cxx
index 1838520ec60a..e9a8cd0aa8b6 100644
--- a/svx/source/gallery2/galleryfilestorage.cxx
+++ b/svx/source/gallery2/galleryfilestorage.cxx
@@ -697,7 +697,8 @@ SvStream& GalleryFileStorage::writeGalleryTheme(SvStream& 
rOStm, const GalleryTh
 rOStm.WriteUInt16(0x0004);
 write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, pThm->GetThemeName(),
  RTL_TEXTENCODING_UTF8);
-rOStm.WriteUInt32(nCount).WriteUInt16(osl_getThreadTextEncoding());
+rOStm.WriteUInt32(nCount);
+rOStm.WriteUInt16(RTL_TEXTENCODING_UTF8); // unused on reading
 
 for (sal_uInt32 i = 0; i < nCount; i++)
 {


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

2023-10-30 Thread Noel Grandin (via logerrit)
 svx/source/unodraw/unoshape.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit e5675d7e03de5962af8828663529a780ca31dd5b
Author: Noel Grandin 
AuthorDate: Mon Oct 30 10:40:03 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 30 14:21:51 2023 +0100

rename mxItemSet->moItemSet in SvxShapeImpl

because the improved naming is useful for a bigger patch that I want to
land

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

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 2ce0ed35c3e6..b6ef17b86616 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -111,7 +111,7 @@ class GDIMetaFile;
 
 struct SvxShapeImpl
 {
-std::optional mxItemSet;
+std::optional moItemSet;
 SdrObjKind  mnObjId;
 SvxShapeMaster* mpMaster;
 boolmbDisposing;
@@ -1534,11 +1534,11 @@ void SvxShape::_setPropertyValue( const OUString& 
rPropertyName, const uno::Any&
 SfxItemSet* pSet;
 if( mbIsMultiPropertyCall && !bIsNotPersist )
 {
-if( !mpImpl->mxItemSet )
+if( !mpImpl->moItemSet )
 {
-mpImpl->mxItemSet.emplace( 
GetSdrObject()->GetProperties().CreateObjectSpecificItemSet( 
GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ) );
+mpImpl->moItemSet.emplace( 
GetSdrObject()->GetProperties().CreateObjectSpecificItemSet( 
GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ) );
 }
-pSet = &*mpImpl->mxItemSet;
+pSet = &*mpImpl->moItemSet;
 }
 else
 {
@@ -1713,15 +1713,15 @@ void SAL_CALL SvxShape::setPropertyValues( const 
css::uno::Sequence< OUString >&
 }
 }
 
-if( mpImpl->mxItemSet && HasSdrObject() )
-GetSdrObject()->SetMergedItemSetAndBroadcast( *mpImpl->mxItemSet );
+if( mpImpl->moItemSet && HasSdrObject() )
+GetSdrObject()->SetMergedItemSetAndBroadcast( *mpImpl->moItemSet );
 }
 
 
 void SvxShape::endSetPropertyValues()
 {
 mbIsMultiPropertyCall = false;
-mpImpl->mxItemSet.reset();
+mpImpl->moItemSet.reset();
 }
 
 


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

2023-10-20 Thread Noel Grandin (via logerrit)
 svx/source/unodraw/unoshape.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 123a0ef011f5627b213aef0a20215970ada30fe6
Author: Noel Grandin 
AuthorDate: Fri Oct 20 10:40:11 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 20 13:26:23 2023 +0200

remove SAL_WARN in _setPropertyValue

since so much code higher level code is now just asking for random
properties and just catching the UnknownPropertyException for the cases
where the object does not support that property

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

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index c7fb448fe575..45d1589728be 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1506,12 +1506,7 @@ void SvxShape::_setPropertyValue( const OUString& 
rPropertyName, const uno::Any&
 }
 
 if (!pMap)
-{
-// reduce log noise by ignoring two properties that higher level code 
queries for on all objects
-SAL_WARN_IF(rPropertyName != "FromWordArt" && rPropertyName != 
"GraphicColorMode",
-"svx.uno", "Unknown Property: " << rPropertyName);
 throw beans::UnknownPropertyException( rPropertyName, getXWeak());
-}
 
 if ((pMap->nFlags & beans::PropertyAttribute::READONLY) != 0)
 throw beans::PropertyVetoException(


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

2023-10-19 Thread Noel Grandin (via logerrit)
 svx/source/sdr/contact/viewcontactofsdrpathobj.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit f5c4635c8bbd27b06a81bfa8d75f986994065310
Author: Noel Grandin 
AuthorDate: Thu Oct 19 11:50:57 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 19 15:20:57 2023 +0200

tdf#155410 small optimisation

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

diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 42b699374e1c..d95d5fbeb75e 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -90,15 +90,13 @@ namespace sdr::contact
 if(bIsLine)
 {
 // special handling for single line mode (2 points)
-const basegfx::B2DPolygon 
aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
-const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
-const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
+const basegfx::B2DPolygon & 
rSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
+const basegfx::B2DPoint aStart(rSubPolygon.getB2DPoint(0));
+const basegfx::B2DPoint aEnd(rSubPolygon.getB2DPoint(1));
 const basegfx::B2DVector aLine(aEnd - aStart);
 
 // #i102548# create new unit polygon for line (horizontal)
-basegfx::B2DPolygon aNewPolygon;
-aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
-aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+static const basegfx::B2DPolygon 
aNewPolygon{basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint(1.0, 0.0)};
 aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
 
 // #i102548# fill objectMatrix with rotation and offset (no 
shear for lines)


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

2023-10-16 Thread Caolán McNamara (via logerrit)
 svx/source/unodraw/unoshape.cxx |   26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 878c2da6d2d5576d6c3266b38eae4ac80bcbe2c1
Author: Caolán McNamara 
AuthorDate: Mon Oct 16 11:52:11 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 16 17:20:28 2023 +0200

Related: tdf#157726 restore try/catch block

before

commit de42529ca9107b24b6367b40801300416d4a51a1
Date:   Wed Sep 6 14:49:19 2023 +0200

replace svx::PropertyValueProvider with simpler implementation

PropertyChangeNotifier::notifyPropertyChange had a try/catch, but
afterwards SvxShape::notifyPropertyChange doesn't

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

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 949728d4bf12..c7fb448fe575 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -264,15 +264,23 @@ void SvxShape::notifyPropertyChange(const OUString& 
rPropName)
 mpImpl->maPropertyChangeListeners.getContainer( g, OUString() );
 if (pPropListeners || pAllListeners)
 {
-// Handle/OldValue not supported
-beans::PropertyChangeEvent aEvt;
-aEvt.Source = static_cast(this);
-aEvt.PropertyName = rPropName;
-aEvt.NewValue = getPropertyValue(rPropName);
-if (pPropListeners)
-pPropListeners->notifyEach( g, 
::XPropertyChangeListener::propertyChange, aEvt );
-if (pAllListeners)
-pAllListeners->notifyEach( g, 
::XPropertyChangeListener::propertyChange, aEvt );
+try
+{
+// Handle/OldValue not supported
+beans::PropertyChangeEvent aEvt;
+aEvt.Source = static_cast(this);
+aEvt.PropertyName = rPropName;
+aEvt.NewValue = getPropertyValue(rPropName);
+if (pPropListeners)
+pPropListeners->notifyEach( g, 
::XPropertyChangeListener::propertyChange, aEvt );
+if (pAllListeners)
+pAllListeners->notifyEach( g, 
::XPropertyChangeListener::propertyChange, aEvt );
+}
+catch( const Exception& )
+{
+DBG_UNHANDLED_EXCEPTION("svx");
+}
+
 }
 }
 


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

2023-10-12 Thread Michael Weghorn (via logerrit)
 svx/source/svdraw/svdhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d1cd490ac0366245c4b55d711611c21149a76e9
Author: Michael Weghorn 
AuthorDate: Thu Oct 12 18:57:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Oct 12 21:10:06 2023 +0200

tdf#141828 svx: Use pointing hand for custom shape handles

Use the *pointing* hand cursor (`PointerStyle::RefHand`)
instead of the hand symbol cursor (`PointerStyle::Hand`)
for handles for custom shape interaction.
(S. how `SdrHdlKind::CustomShape1` is only specified in
`SdrObjCustomShape::AddToHdlList`, except for read-only
switch/cases elsewhere).

As mentioned in tdf#141828, this has the advantage that
the user can see where the handle is being moved.

For gtk3, this doesn't make any difference in practice,
because it's using the same cursor type for both,
`PointerStyle::RefHand` and `PointerStyle::Hand`
(s. `GtkSalDisplay::getCursor`, but the Qt-based VCL
plugins (`QtData::getCursor`) and macOS
(s. `AquaSalFrame::getCurrentCursor`) make a
distinction between them.

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

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index deb8da05d9d5..867534e9a08f 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1011,7 +1011,7 @@ PointerStyle SdrHdl::GetPointer() const
 case SdrHdlKind::Ref2 : ePtr=PointerStyle::RefHand;   break;
 case SdrHdlKind::BezierWeight : 
ePtr=PointerStyle::MoveBezierWeight; break;
 case SdrHdlKind::Glue : ePtr=PointerStyle::MovePoint; break;
-case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::Hand; break;
+case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::RefHand; 
break;
 default:
 break;
 }


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

2023-10-07 Thread Julien Nabet (via logerrit)
 svx/source/customshapes/EnhancedCustomShape3d.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit cc81d424a29dd4b421bc1775faaa51c58195fadc
Author: Julien Nabet 
AuthorDate: Fri Oct 6 17:29:54 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Oct 7 09:57:31 2023 +0200

Related tdf#157532: deal "ShadeMode" for extruded custom shapes via BASIC 
macro

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

diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index e543f490ca8a..a401246277cc 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -141,7 +141,16 @@ drawing::ShadeMode GetShadeMode( const 
SdrCustomShapeGeometryItem& rItem, const
 drawing::ShadeMode eRet( eDefault );
 const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "ShadeMode" );
 if ( pAny )
-*pAny >>= eRet;
+{
+if (!(*pAny >>= eRet))
+{
+sal_Int32 nEnum = 0;
+if(*pAny >>= nEnum)
+{
+eRet = static_cast(nEnum);
+}
+}
+}
 return eRet;
 }
 


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

2023-10-06 Thread Julien Nabet (via logerrit)
 svx/source/customshapes/EnhancedCustomShape3d.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit f1aa554cd0b471e0c9424ece7ab3d9b3d7723a1d
Author: Julien Nabet 
AuthorDate: Fri Oct 6 17:19:28 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 6 20:04:01 2023 +0200

tdf#157532: deal "ProjectionMode" for extruded custom shapes via BASIC macro

I took example on SdrTextAniDirectionItem::PutValue from 
svx/source/svdraw/svdattr.cxx

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

diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 468a1c66fa93..e543f490ca8a 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -332,8 +332,17 @@ rtl::Reference 
EnhancedCustomShape3d::Create3DObject(
 
 drawing::ProjectionMode eProjectionMode( 
drawing::ProjectionMode_PARALLEL );
 const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", 
"ProjectionMode" );
-if ( pAny )
-*pAny >>= eProjectionMode;
+if (pAny)
+{
+if(!(*pAny >>= eProjectionMode))
+{
+sal_Int32 nEnum = 0;
+if(*pAny >>= nEnum)
+{
+eProjectionMode = 
static_cast(nEnum);
+}
+}
+}
 // pShape2d Convert in scenes which include 3D Objects
 E3dDefaultAttributes a3DDefaultAttr;
 a3DDefaultAttr.SetDefaultLatheCharacterMode( true );


  1   2   3   4   5   6   7   8   9   10   >