core.git: svtools/source

2024-05-06 Thread Heiko Tietze (via logerrit)
 svtools/source/control/valueset.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit abccf22947294cfc2d9c4b727b7fd059bed55f0b
Author: Heiko Tietze 
AuthorDate: Tue Apr 30 10:23:34 2024 +0200
Commit: Heiko Tietze 
CommitDate: Mon May 6 16:26:13 2024 +0200

Resolves tdf#136917 - Focus rectangle barely visible on toolbar widgets

eg. Toggle Unordered List

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 0127ea7a1901..58364b4aebfc 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1255,9 +1256,15 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& 
rRenderContext,
 if (bDrawSel)
 {
 rRenderContext.SetLineColor(aDoubleColor);
-tools::PolyPolygon aPolyPoly(1);
-aPolyPoly.Insert(tools::Polygon(aRect));
-rRenderContext.DrawTransparent(aPolyPoly, nTransparencePercent);
+aRect.AdjustLeft( -1 );
+aRect.AdjustTop( -1 );
+aRect.AdjustRight( -2 );
+aRect.AdjustBottom( -2 );
+
+const tools::Polygon aPoly(aRect);
+LineInfo aLineInfo;
+aLineInfo.SetWidth(3);
+rRenderContext.DrawPolyLine(aPoly, aLineInfo); // tdf#136917
 }
 }
 else
@@ -1343,6 +1350,7 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& 
rRenderContext,
 rRenderContext.SetLineColor(aSingleColor);
 else
 rRenderContext.SetLineColor(COL_LIGHTGRAY);
+
 rRenderContext.DrawRect(aFocusRect);
 }
 }


core.git: svtools/source

2024-04-04 Thread Miklos Vajna (via logerrit)
 svtools/source/misc/embedhlp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 57f02bb1015e7fc811b57ed618eefd54b9465426
Author: Miklos Vajna 
AuthorDate: Thu Apr 4 09:19:27 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 4 11:38:18 2024 +0200

svtools: improve font name in EmbeddedObjectRef::DrawPaintReplacement()

Once CppunitTest_sw_uibase_shells sets non_application_font_use to
abort, it would fail here with:

warn:vcl.fonts:29463:29463:vcl/unx/generic/fontmanager/fontconfig.cxx:1192: 
PrintFontManager::Substitute: missing font: 'Helvetica' try: Liberation Sans 
instead

Fix the problem similar to what commit
1d9221ebc86f2696a65c12287ea19eea44d680cf (tdf#124601 sw: fix misplaced
images in table cells, 2022-11-30) did: use a font that we ship to avoid
font fallback.

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

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 370d0f6b10ca..38321e843e0d 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -742,7 +742,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const 
tools::Rectangle , con
 {
 MapMode aMM( MapUnit::MapAppFont );
 Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), , nullptr );
-vcl::Font aFnt( "Helvetica", aAppFontSz );
+vcl::Font aFnt( "Noto Sans", aAppFontSz );
 aFnt.SetTransparent( true );
 aFnt.SetColor( COL_LIGHTRED );
 aFnt.SetWeight( WEIGHT_BOLD );


core.git: svtools/source

2024-04-03 Thread Gabor Kelemen (via logerrit)
 svtools/source/brwbox/brwbox3.cxx  |2 --
 svtools/source/config/accessibilityoptions.cxx |3 ---
 svtools/source/config/miscopt.cxx  |1 -
 svtools/source/config/printoptions.cxx |3 ---
 svtools/source/control/inettbc.cxx |1 -
 svtools/source/control/ruler.cxx   |1 -
 svtools/source/control/toolbarmenu.cxx |1 -
 svtools/source/control/valueset.cxx|1 -
 svtools/source/dialogs/addresstemplate.cxx |1 -
 svtools/source/dialogs/colrdlg.cxx |1 -
 svtools/source/misc/dialogclosedlistener.cxx   |1 -
 svtools/source/misc/stringtransfer.cxx |1 -
 svtools/source/uno/addrtempuno.cxx |1 -
 svtools/source/uno/framestatuslistener.cxx |1 -
 14 files changed, 19 deletions(-)

New commits:
commit 2c2c1d274fe6336f4f88dd2fb9f716c1d1b092d2
Author: Gabor Kelemen 
AuthorDate: Fri Mar 29 14:08:57 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Wed Apr 3 08:58:06 2024 +0200

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

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

diff --git a/svtools/source/brwbox/brwbox3.cxx 
b/svtools/source/brwbox/brwbox3.cxx
index 32ab1807ac69..1237060a1b89 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -35,8 +35,6 @@ using namespace ::com::sun::star::accessibility;
 
 namespace svt
 {
-using namespace ::com::sun::star::lang;
-
 static Reference< XAccessible > getHeaderCell( 
BrowseBoxImpl::THeaderCellMap& _raHeaderCells,
 sal_Int32 _nPos,
 AccessibleBrowseBoxObjType _eType,
diff --git a/svtools/source/config/accessibilityoptions.cxx 
b/svtools/source/config/accessibilityoptions.cxx
index 949404491805..f931bf4aa890 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -35,9 +35,6 @@
 
 #include 
 
-using namespace utl;
-using namespace com::sun::star::uno;
-
 #define HELP_TIP_TIMEOUT 0x // max. timeout setting to pretend a 
non-timeout
 
 namespace SvtAccessibilityOptions
diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index ca8537b1c38c..31257615c2b1 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -37,7 +37,6 @@
 #include 
 
 using namespace ::utl   ;
-using namespace ::osl   ;
 using namespace ::com::sun::star::uno   ;
 using namespace ::com::sun::star;
 
diff --git a/svtools/source/config/printoptions.cxx 
b/svtools/source/config/printoptions.cxx
index 3f6293813a09..769afbde2cb1 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -27,9 +27,6 @@ const sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
 
 #define DPI_COUNT (SAL_N_ELEMENTS(aDPIArray))
 
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-
 namespace svtools
 {
 
diff --git a/svtools/source/control/inettbc.cxx 
b/svtools/source/control/inettbc.cxx
index 0ffad5414c08..fb98ebb45182 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -60,7 +60,6 @@ using namespace ::ucbhelper;
 using namespace ::utl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::task;
 using namespace ::com::sun::star::ucb;
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 5dbe5014f94b..f26240107f9f 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -37,7 +37,6 @@
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
 #define RULER_OFF   3
diff --git a/svtools/source/control/toolbarmenu.cxx 
b/svtools/source/control/toolbarmenu.cxx
index 92519ad356ad..8a1761a7006e 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -31,7 +31,6 @@
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::accessibility;
 
 namespace {
 
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 87696d1a7886..0127ea7a1901 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -43,7 +43,6 @@
 #include 
 
 using namespace css::uno;
-using namespace css::lang;
 using namespace css::accessibility;
 
 namespace
diff --git a/svtools/source/dialogs/addresstemplate.cxx 

core.git: svtools/source

2024-03-27 Thread Caolán McNamara (via logerrit)
 svtools/source/misc/embedhlp.cxx |   21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 8872f7121b4ae4dd0b51820366d3510a88f7aac2
Author: Caolán McNamara 
AuthorDate: Tue Mar 26 21:42:51 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 27 10:02:15 2024 +0100

crashtesting: crash on exporting kde274105-6.docx to .rtf

since:

commit 9ae8e74fb32254c81d36b1c95411605459e06372
Date:   Tue Mar 5 11:01:42 2024 -0700

tdf#50934: Add a pie-with-remainder-as-another-pie chart type

but this sort of problem has arisen before at:

commit 3a2c2ad839860dcb36e30ae1a2867e4d5e1036fc
Date:   Wed Jan 30 10:12:44 2019 +

crashtesting: crash exporting ooo58458-1.odt to doc

since...

commit 8780fa41dcd164af244742461f4e57a4bcf4c7a4
Date:   Tue Oct 30 12:23:36 2018 +0100

svtools: fix lost replacement grpahic when updating it via OLE fails

and back in:

commit ca9dd36bb0f2f8a5bcb0e5621ec181cc6f29ad73
Date:   Tue May 22 18:34:28 2007 +

INTEGRATION: CWS chart2mst3 (1.16.4); FILE MERGED
2006/08/04 09:32:02 iha 1.16.4.1: don't crash while resizing some 
charts when replacement graphic happens to be empty

the same issue of charts triggering UpdateReplacementOnDemand on
modifications which happen during generating the Replacement Graphic.

Presumably no modifications should happen during this process and those
are the underlying bugs.

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

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index d784b20a4a39..370d0f6b10ca 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -461,12 +461,10 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
 
 mpImpl->oGraphic.reset();
 mpImpl->aMediaType.clear();
-mpImpl->oGraphic.emplace();
 mpImpl->mnGraphicVersion++;
 }
 else if ( !mpImpl->oGraphic )
 {
-mpImpl->oGraphic.emplace();
 mpImpl->mnGraphicVersion++;
 }
 else
@@ -475,6 +473,8 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
 return;
 }
 
+mpImpl->oGraphic.emplace();
+
 std::unique_ptr pGraphicStream(GetGraphicStream( bUpdate ));
 if (!pGraphicStream && aOldGraphic.IsNone())
 {
@@ -485,17 +485,24 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
  "EmbeddedObjectRef::GetReplacement: failed to get updated 
graphic stream");
 }
 
+if (!mpImpl->oGraphic)
+{
+// note that UpdateReplacementOnDemand which resets mpImpl->oGraphic 
to null may have been called
+// e.g. when exporting ooo58458-1.odt to doc or kde274105-6.docx to 
rtf. Those looks like bugs as
+// presumably generating the replacement graphic shouldn't re-trigger 
that the graphic needs
+// to be updated, bodge this to work as callers naturally expect
+SAL_WARN("svtools.misc", "EmbeddedObjectRef::GetReplacement generating 
replacement image modified object to claim it needs to update replacement");
+mpImpl->oGraphic.emplace();
+}
+
 if ( pGraphicStream )
 {
 GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
-if( mpImpl->oGraphic )
-rGF.ImportGraphic( *mpImpl->oGraphic, u"", *pGraphicStream );
+rGF.ImportGraphic( *mpImpl->oGraphic, u"", *pGraphicStream );
 mpImpl->mnGraphicVersion++;
 }
 
-// note that UpdateReplacementOnDemand which resets mpImpl->oGraphic to 
null may have been called
-// e.g. when exporting ooo58458-1.odt to doc
-if (bUpdate && (!mpImpl->oGraphic || mpImpl->oGraphic->IsNone()) && 
!aOldGraphic.IsNone())
+if (bUpdate && mpImpl->oGraphic->IsNone() && !aOldGraphic.IsNone())
 {
 // We used to have an old graphic, tried to update and the update
 // failed. Go back to the old graphic instead of having no graphic at


core.git: svtools/source

2024-02-28 Thread Caolán McNamara (via logerrit)
 svtools/source/svhtml/parhtml.cxx |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit b8237d35d9f90d1dfdd35f24af8729d668029e2c
Author: Caolán McNamara 
AuthorDate: Wed Feb 28 14:17:55 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Feb 28 20:30:42 2024 +0100

ofz#67092 Integer-overflow

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

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index 1f8745674469..b2620b5a49e6 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -2073,14 +2073,16 @@ bool HTMLParser::ParseMetaOptionsImpl(
 if (comphelper::string::getTokenCount(aContent, ';') == 2)
 {
 sal_Int32 nIdx{ 0 };
-Date aDate(o3tl::toInt32(o3tl::getToken(aContent, 0, ';', 
nIdx)));
-auto nTime = o3tl::toInt64(o3tl::getToken(aContent, 0, 
';', nIdx));
-if (nTime < 0)
-nTime = o3tl::saturating_toggle_sign(nTime);
-tools::Time aTime(nTime);
-DateTime aDateTime(aDate, aTime);
-uDT = aDateTime.GetUNODateTime();
-valid = true;
+sal_Int32 nDate = o3tl::toInt32(o3tl::getToken(aContent, 
0, ';', nIdx));
+sal_Int64 nTime = o3tl::toInt64(o3tl::getToken(aContent, 
0, ';', nIdx));
+valid = nDate != std::numeric_limits::min() &&
+nTime != std::numeric_limits::min();
+if (valid)
+{
+Date aDate(nDate);
+tools::Time aTime(nTime);
+uDT = DateTime(aDate, aTime).GetUNODateTime();
+}
 }
 else if (utl::ISO8601parseDateTime(aContent, uDT))
 valid = true;


core.git: svtools/source

2024-02-08 Thread Xisco Fauli (via logerrit)
 svtools/source/dialogs/PlaceEditDialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a381e87d16496d9fee98d9ff49fa2a38cc5c8fb2
Author: Xisco Fauli 
AuthorDate: Thu Feb 8 11:54:52 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Feb 8 13:39:11 2024 +0100

tdf#159637: fix position of 'Windows Share' entry

Started to happen after

commit b91daea3c1a38883c06cdd63c6eababe1df9e61d
Author: Michael Stahl 
Date:   Tue Nov 7 13:20:21 2023 +0100

tdf#146386 fpicker,svtools: remove FTP from Remote Files dialog

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

diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx 
b/svtools/source/dialogs/PlaceEditDialog.cxx
index 7d0c7717e2f1..a51486e408a8 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -222,7 +222,7 @@ void PlaceEditDialog::InitDetails( )
 #if defined(_WIN32)
 // nPos is the position of first item that is pre-defined in 
svtools/uiconfig/ui/placeedit.ui,
 // after other CMIS types were inserted
-m_xLBServerType->remove(nPos + 3);
+m_xLBServerType->remove(nPos + 2);
 #else
 // Create Windows Share control
 std::shared_ptr 
xSmbDetails(std::make_shared(this));


core.git: svtools/source

2024-02-02 Thread Andreas Heinisch (via logerrit)
 svtools/source/uno/statusbarcontroller.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2441344bf1e8586a1ce181e73504fde0f9d2282e
Author: Andreas Heinisch 
AuthorDate: Thu Feb 1 22:54:53 2024 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Feb 2 10:07:23 2024 +0100

tdf#91914 - Open available options through status bar using single click

Enable one-click access to available options in Calc through the status
bar, ensuring consistency with Writer and other applications.

Change-Id: Ia6c52ed9ae6e316a69f9aad9e80384cfa18feb47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162916
Reviewed-by: Jim Raykowski 
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/svtools/source/uno/statusbarcontroller.cxx 
b/svtools/source/uno/statusbarcontroller.cxx
index 5baa311e9a4a..3bf6de2cf103 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -312,10 +312,6 @@ void SAL_CALL StatusbarController::paint(
 }
 
 void SAL_CALL StatusbarController::click( const css::awt::Point& )
-{
-}
-
-void SAL_CALL StatusbarController::doubleClick( const css::awt::Point& )
 {
 SolarMutexGuard aSolarMutexGuard;
 
@@ -326,6 +322,10 @@ void SAL_CALL StatusbarController::doubleClick( const 
css::awt::Point& )
 execute( aArgs );
 }
 
+void SAL_CALL StatusbarController::doubleClick( const css::awt::Point& )
+{
+}
+
 void StatusbarController::addStatusListener( const OUString& aCommandURL )
 {
 Reference< XDispatch >   xDispatch;


core.git: svtools/source

2024-01-26 Thread Heiko Tietze (via logerrit)
 svtools/source/config/colorcfg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 381ab9a1a38e4ea9238599e62acd430782a80547
Author: Heiko Tietze 
AuthorDate: Fri Jan 26 09:05:12 2024 +0100
Commit: Heiko Tietze 
CommitDate: Fri Jan 26 11:11:40 2024 +0100

Resolves tdf#159096 - Change color of comment indicators in Calc

COL_LIGHTMAGENT was preceived as too glossy and "Light Purple 3"
should also be closer to the Excel prototype

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

diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index dea9ca97db2f..4a4e94370bef 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -422,7 +422,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
 { COL_GRAY7,COL_GRAY7   }, // CALCPAGEBREAKAUTOMATIC
 { Color(0x2300dc),  Color(0x2300DC) }, // CALCHIDDENCOLROW
 { COL_LIGHTRED, COL_LIGHTRED}, // CALCTEXTOVERFLOW
-{ COL_LIGHTMAGENTA, COL_LIGHTMAGENTA}, // CALCCOMMENT
+{ Color(0xbf819e),  Color(0xbf819e) }, // CALCCOMMENT
 { COL_LIGHTBLUE,Color(0x355269) }, // CALCDETECTIVE
 { COL_LIGHTRED, Color(0xC9211E) }, // CALCDETECTIVEERROR
 { Color(0xef0fff),  Color(0x0D23D5) }, // CALCREFERENCE


core.git: svtools/source vcl/qt5

2024-01-16 Thread Julien Nabet (via logerrit)
 svtools/source/brwbox/editbrowsebox.cxx |2 +-
 vcl/qt5/QtAccessibleEventListener.cxx   |   10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 1a637a07a0fb23f4d4bfac69378caff7ee965737
Author: Julien Nabet 
AuthorDate: Tue Jan 16 19:24:56 2024 +0100
Commit: Julien Nabet 
CommitDate: Tue Jan 16 23:27:46 2024 +0100

tdf#159213: fix Base crash when choosing "Help" in relations design (kf5)

There are 2 parts here:
1) in vcl/qt5:
- for release versions: avoid to call QtAccessibleRegistry::getQObject on a 
null object
- for debug version: add an assertion on object to check it's not null

2) in svtools:
the specific root cause  was in EditBrowseBox::DeactivateCell,
we must check m_aImpl->m_xActiveCell in addition to isAccessibleAlive()

Import remark: I had a very naive/bandaid patch at the beginning
this one is entirely thanks to Michael Weghorn

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

diff --git a/svtools/source/brwbox/editbrowsebox.cxx 
b/svtools/source/brwbox/editbrowsebox.cxx
index 927e203dd14a..515c102379b3 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -967,7 +967,7 @@ namespace svt
 if (!IsEditing())
 return;
 
-if ( isAccessibleAlive() )
+if ( isAccessibleAlive() && m_aImpl->m_xActiveCell)
 {
 commitBrowseBoxEvent( CHILD, Any(), Any( m_aImpl->m_xActiveCell ) 
);
 m_aImpl->clearActiveCell();
diff --git a/vcl/qt5/QtAccessibleEventListener.cxx 
b/vcl/qt5/QtAccessibleEventListener.cxx
index d6a404e6947e..0bf4dcddbf2d 100644
--- a/vcl/qt5/QtAccessibleEventListener.cxx
+++ b/vcl/qt5/QtAccessibleEventListener.cxx
@@ -213,12 +213,22 @@ void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::Accessible
 Reference xChild;
 if (aEvent.NewValue >>= xChild)
 {
+assert(xChild.is()
+   && "AccessibleEventId::CHILD event NewValue without 
valid child set");
+// tdf#159213 for now, workaround invalid events being sent 
and don't crash in release builds
+if (!xChild.is())
+return;
 QAccessible::updateAccessibility(new QAccessibleEvent(
 QtAccessibleRegistry::getQObject(xChild), 
QAccessible::ObjectCreated));
 return;
 }
 if (aEvent.OldValue >>= xChild)
 {
+assert(xChild.is()
+   && "AccessibleEventId::CHILD event OldValue without 
valid child set");
+// tdf#159213 for now, workaround invalid events being sent 
and don't crash in release builds
+if (!xChild.is())
+return;
 QAccessible::updateAccessibility(new QAccessibleEvent(
 QtAccessibleRegistry::getQObject(xChild), 
QAccessible::ObjectDestroyed));
 return;


core.git: svtools/source

2023-12-28 Thread Julien Nabet (via logerrit)
 svtools/source/uno/framestatuslistener.cxx |2 +-
 svtools/source/uno/statusbarcontroller.cxx |2 +-
 svtools/source/uno/toolboxcontroller.cxx   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b33c45422801da708716b1157a7559910b577b5a
Author: Julien Nabet 
AuthorDate: Thu Dec 28 14:30:51 2023 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 28 18:31:11 2023 +0100

Use emplace_back instead of push_back (svtools)

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

diff --git a/svtools/source/uno/framestatuslistener.cxx 
b/svtools/source/uno/framestatuslistener.cxx
index 166433dff1b9..aa82e5880efe 100644
--- a/svtools/source/uno/framestatuslistener.cxx
+++ b/svtools/source/uno/framestatuslistener.cxx
@@ -241,7 +241,7 @@ void FrameStatusListener::bindListener()
 }
 listener.second = xDispatch;
 
-aDispatchVector.push_back( Listener( std::move(aTargetURL), 
xDispatch ) );
+aDispatchVector.emplace_back(std::move(aTargetURL), xDispatch);
 }
 }
 }
diff --git a/svtools/source/uno/statusbarcontroller.cxx 
b/svtools/source/uno/statusbarcontroller.cxx
index 7ab3a2e29c40..5baa311e9a4a 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -442,7 +442,7 @@ void StatusbarController::bindListener()
 }
 listener.second = xDispatch;
 
-aDispatchVector.push_back( Listener( std::move(aTargetURL), 
xDispatch ) );
+aDispatchVector.emplace_back(std::move(aTargetURL), xDispatch);
 }
 }
 }
diff --git a/svtools/source/uno/toolboxcontroller.cxx 
b/svtools/source/uno/toolboxcontroller.cxx
index 90f44c1d5e4b..f1f97fd88c52 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -541,7 +541,7 @@ void ToolboxController::bindListener()
 
 listener.second = xDispatch;
 
-aDispatchVector.push_back( Listener( aTargetURL, xDispatch ) );
+aDispatchVector.emplace_back(aTargetURL, xDispatch);
 }
 }
 }


core.git: svtools/source

2023-12-21 Thread Andreas Heinisch (via logerrit)
 svtools/source/control/tabbar.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 3430a2c639a9f714259f9d319515464a653d21ab
Author: Andreas Heinisch 
AuthorDate: Thu Dec 21 20:33:20 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Thu Dec 21 20:33:47 2023 +0100

Revert "tdf#100584 - Arrange sheets in the tab bar depending on the RTL 
settings"

This reverts commit be86c8f2432623fdb8ed4f22ca08c35121fd8bec.

Reason for revert: To many regressions.

Change-Id: Id3fb8dc5d4edb84c0008b7834a80887aaa7d9f83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161154
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index dafdf5f7e218..58fa5d76de3a 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -710,15 +710,10 @@ void TabBar::ImplFormat()
 if (!mbFormat)
 return;
 
+sal_uInt16 nItemIndex = 0;
 tools::Long x = mnOffX;
-
-const size_t nItemListSize = mpImpl->maItemList.size();
-for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
+for (auto & rItem : mpImpl->maItemList)
 {
-// tdf#100584 - arrange sheets depending on the RTL settings
-auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - 
nItemIndex - 1]
- : mpImpl->maItemList[nItemIndex];
-
 // At all non-visible tabs an empty rectangle is set
 if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
 rItem.maRect.SetEmpty();
@@ -746,6 +741,8 @@ void TabBar::ImplFormat()
 rItem.maRect.SetLeft(nNewLeft);
 }
 }
+
+nItemIndex++;
 }
 
 mbFormat = false;


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

2023-11-19 Thread Julien Nabet (via logerrit)
 svtools/source/config/miscopt.cxx |2 +-
 svtools/source/dialogs/insdlg.cxx |4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 31795be8ee5bcc113f2d18d315f842a89e95b316
Author: Julien Nabet 
AuthorDate: Sun Nov 19 20:52:41 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Nov 20 07:38:52 2023 +0100

c++20: use std::erase(_if) instead of std::remove(_if)+erase (svtools)

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

diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index 625086eee24c..ca8537b1c38c 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -228,7 +228,7 @@ void SvtMiscOptions_Impl::AddListenerLink( const 
Link& rLin
 
 void SvtMiscOptions_Impl::RemoveListenerLink( const Link& 
rLink )
 {
-aList.erase(std::remove(aList.begin(), aList.end(), rLink), aList.end());
+std::erase(aList, rLink);
 }
 
 void SvtMiscOptions_Impl::CallListeners()
diff --git a/svtools/source/dialogs/insdlg.cxx 
b/svtools/source/dialogs/insdlg.cxx
index 7fe1728f4194..50fad4a75dcd 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -97,9 +97,7 @@ const SvObjectServer * SvObjectServerList::Get( const 
SvGlobalName & rName ) con
 
 void SvObjectServerList::Remove( const SvGlobalName & rName )
 {
-aObjectServerList.erase(std::remove_if(aObjectServerList.begin(), 
aObjectServerList.end(),
-[rName](const SvObjectServer& rServer) { return rServer.GetClassName() 
== rName; }),
-aObjectServerList.end());
+std::erase_if(aObjectServerList, [rName](const SvObjectServer& rServer) { 
return rServer.GetClassName() == rName; });
 }
 
 


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

2023-10-20 Thread Stephan Bergmann (via logerrit)
 svtools/source/config/extcolorcfg.cxx   |4 ++--
 svtools/source/config/fontsubstconfig.cxx   |   12 ++--
 svtools/source/config/miscopt.cxx   |8 
 svtools/source/config/slidesorterbaropt.cxx |   12 ++--
 svtools/source/dialogs/colrdlg.cxx  |6 +++---
 svtools/source/filter/exportdialog.cxx  |4 ++--
 svtools/source/misc/sampletext.cxx  |4 ++--
 svtools/source/uno/toolboxcontroller.cxx|2 +-
 svtools/source/uno/unoevent.cxx |   20 ++--
 9 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit 96cbf1a4c3093a4cc339da68907f67f9a30f3916
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:31 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 10:35:44 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: svtools

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

diff --git a/svtools/source/config/extcolorcfg.cxx 
b/svtools/source/config/extcolorcfg.cxx
index 8707f6b36af3..da3ce6a2de46 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -318,7 +318,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(const 
uno::Sequence < OUStrin
 uno::Sequence < OUString > aColorNames = GetPropertyNames(sEntry);
 uno::Sequence < OUString > aDefaultColorNames = aColorNames;
 
-static constexpr OUStringLiteral sColor(u"/Color");
+static constexpr OUString sColor(u"/Color"_ustr);
 lcl_addString(aColorNames,sColor);
 lcl_addString(aDefaultColorNames,u"/DefaultColor");
 uno::Sequence< uno::Any > aColors = GetProperties( aColorNames );
@@ -388,7 +388,7 @@ void ExtendedColorConfig_Impl::ImplCommit()
 static constexpr OUStringLiteral sColor(u"/Color");
 OUString sBase = "ExtendedColorScheme/ColorSchemes/"
+ m_sLoadedScheme;
-static constexpr OUStringLiteral s_sSep(u"/");
+static constexpr OUString s_sSep(u"/"_ustr);
 
 for (auto const& configValue : m_aConfigValues)
 {
diff --git a/svtools/source/config/fontsubstconfig.cxx 
b/svtools/source/config/fontsubstconfig.cxx
index 6d7323bb0d44..66a7a4e038ef 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -32,13 +32,13 @@ using namespace com::sun::star::uno;
 using namespace com::sun::star::beans;
 
 
-constexpr OUStringLiteral cReplacement = u"Replacement";
-constexpr OUStringLiteral cFontPairs = u"FontPairs";
+constexpr OUString cReplacement = u"Replacement"_ustr;
+constexpr OUString cFontPairs = u"FontPairs"_ustr;
 
-constexpr OUStringLiteral cReplaceFont = u"ReplaceFont";
-constexpr OUStringLiteral cSubstituteFont= u"SubstituteFont";
-constexpr OUStringLiteral cOnScreenOnly = u"OnScreenOnly";
-constexpr OUStringLiteral cAlways = u"Always";
+constexpr OUString cReplaceFont = u"ReplaceFont"_ustr;
+constexpr OUString cSubstituteFont= u"SubstituteFont"_ustr;
+constexpr OUString cOnScreenOnly = u"OnScreenOnly"_ustr;
+constexpr OUString cAlways = u"Always"_ustr;
 
 namespace svtools
 {
diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index fe9788eee14b..625086eee24c 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -44,11 +44,11 @@ using namespace ::com::sun::star;
 constexpr OUStringLiteral ROOTNODE_MISC = u"Office.Common/Misc";
 
 // PROPERTYHANDLE defines must be sequential from zero for Commit/Load
-constexpr OUStringLiteral PROPERTYNAME_SYMBOLSET = u"SymbolSet";
-constexpr OUStringLiteral PROPERTYNAME_ICONTHEME = u"SymbolStyle";
+constexpr OUString PROPERTYNAME_SYMBOLSET = u"SymbolSet"_ustr;
+constexpr OUString PROPERTYNAME_ICONTHEME = u"SymbolStyle"_ustr;
 #define PROPERTYHANDLE_SYMBOLSTYLE  1
-constexpr OUStringLiteral PROPERTYNAME_SIDEBARICONSIZE = u"SidebarIconSize";
-constexpr OUStringLiteral PROPERTYNAME_NOTEBOOKBARICONSIZE = 
u"NotebookbarIconSize";
+constexpr OUString PROPERTYNAME_SIDEBARICONSIZE = u"SidebarIconSize"_ustr;
+constexpr OUString PROPERTYNAME_NOTEBOOKBARICONSIZE = 
u"NotebookbarIconSize"_ustr;
 
 static std::mutex & GetInitMutex()
 {
diff --git a/svtools/source/config/slidesorterbaropt.cxx 
b/svtools/source/config/slidesorterbaropt.cxx
index 784e0894ef27..4001c2de9e08 100644
--- a/svtools/source/config/slidesorterbaropt.cxx
+++ b/svtools/source/config/slidesorterbaropt.cxx
@@ -35,17 +35,17 @@ using namespace ::com::sun::star;
 
 constexpr OUStringLiteral ROOTNODE_SLIDESORTERBAR = 
u"Office.Impress/MultiPaneGUI/SlideSorterBar/Visible";
 
-constexpr OUStringLiteral PROPERTYNAME_VISIBLE_IMPRESSVIEW = u"ImpressView";
+constexpr OUString PROPERTYNAME_VISIBLE_IMPRESSVIEW = u"ImpressView"_ustr;
 #define PROPERTYHANDLE_VISIBLE_IMPRESSVIEW 0
-constexpr 

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

2023-10-19 Thread Adam Seskunas (via logerrit)
 svtools/source/control/ctrlbox.cxx  |4 ++--
 svtools/source/control/valueset.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1e6c1b672b1b93376f3c816e870d956b84e089e7
Author: Adam Seskunas 
AuthorDate: Wed Sep 20 13:54:44 2023 -0700
Commit: Hossein 
CommitDate: Fri Oct 20 03:37:45 2023 +0200

tdf#114441 Convert use of sal_uLong to better integer types

In ctrlbox.cxx, nCount and i were changed to sal_uInt32 because
aFontSizeNames.Count() returns sal_uInt32.

In valueset.cxx, nFirstItem and nLastItem are only used in a comparison
with a value of size_t. They were both changed to size_t because
nLastItem contains the product of tools::Long mnVisLines and
sal_uInt16 mnCols where tools::Long can be 64 bit in some cases.

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 22bfde7febe5..3d4ce47b0814 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1186,8 +1186,8 @@ void FontSizeBox::Fill( const FontList* pList )
 if ( pAry == FontList::GetStdSizeAry() )
 {
 // for scalable fonts all font size names
-sal_uLong nCount = aFontSizeNames.Count();
-for( sal_uLong i = 0; i < nCount; i++ )
+sal_uInt32 nCount = aFontSizeNames.Count();
+for( sal_uInt32 i = 0; i < nCount; i++ )
 {
 OUString aSizeName = aFontSizeNames.GetIndexName( i );
 int nSize = aFontSizeNames.GetIndexSize( i );
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 89ce7f8cdb23..87696d1a7886 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1076,8 +1076,8 @@ void ValueSet::Format(vcl::RenderContext const & 
rRenderContext)
 }
 
 // draw items
-sal_uLong nFirstItem = static_cast(mnFirstLine) * mnCols;
-sal_uLong nLastItem = nFirstItem + (mnVisLines * mnCols);
+size_t nFirstItem = static_cast(mnFirstLine) * mnCols;
+size_t nLastItem = nFirstItem + (mnVisLines * mnCols);
 
 maItemListRect.SetLeft( x );
 maItemListRect.SetTop( y );


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

2023-10-07 Thread Szymon Kłos (via logerrit)
 svtools/source/control/ctrlbox.cxx |   83 +++--
 1 file changed, 62 insertions(+), 21 deletions(-)

New commits:
commit d1da6fbf805e5b4c3f22f18941ac240cbd3d8277
Author: Szymon Kłos 
AuthorDate: Mon Aug 28 13:00:15 2023 +0200
Commit: Szymon Kłos 
CommitDate: Sat Oct 7 17:05:26 2023 +0200

jsdialog: cache only best quality font previews

to keep single cache for all the views, we downscale
result if needed when we draw on a target

Change-Id: I3b57ec08b2260029ff469a13da725feff04555d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156190
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157671
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index e5b0883ad87e..22bfde7febe5 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -333,9 +333,32 @@ static int gFontNameBoxes;
 static size_t gPreviewsPerDevice;
 static std::vector> gFontPreviewVirDevs;
 static std::vector gRenderedFontNames;
+static int gHighestDPI = 0;
 
 namespace
 {
+std::vector>& getFontPreviewVirDevs()
+{
+return gFontPreviewVirDevs;
+}
+
+void clearFontPreviewVirDevs()
+{
+for (auto  : gFontPreviewVirDevs)
+rDev.disposeAndClear();
+gFontPreviewVirDevs.clear();
+}
+
+std::vector& getRenderedFontNames()
+{
+return gRenderedFontNames;
+}
+
+void clearRenderedFontNames()
+{
+gRenderedFontNames.clear();
+}
+
 void calcCustomItemSize(const weld::ComboBox& rComboBox)
 {
 gUserItemSz = Size(rComboBox.get_approximate_digit_width() * 52, 
rComboBox.get_text_height());
@@ -355,13 +378,14 @@ IMPL_LINK(FontNameBox, SettingsChangedHdl, 
VclSimpleEvent&, rEvent, void)
 if (rEvent.GetId() != VclEventId::ApplicationDataChanged)
 return;
 
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 DataChangedEvent* pData = 
static_cast(static_cast(rEvent).GetData());
 if (pData->GetType() == DataChangedEventType::SETTINGS)
 {
-for (auto  : gFontPreviewVirDevs)
-rDev.disposeAndClear();
-gFontPreviewVirDevs.clear();
-gRenderedFontNames.clear();
+clearFontPreviewVirDevs();
+clearRenderedFontNames();
 calcCustomItemSize(*m_xComboBox);
 if (mbWYSIWYG && mpFontList && !mpFontList->empty())
 {
@@ -398,10 +422,8 @@ FontNameBox::~FontNameBox()
 --gFontNameBoxes;
 if (!gFontNameBoxes)
 {
-for (auto  : gFontPreviewVirDevs)
-rDev.disposeAndClear();
-gFontPreviewVirDevs.clear();
-gRenderedFontNames.clear();
+clearFontPreviewVirDevs();
+clearRenderedFontNames();
 }
 }
 
@@ -769,16 +791,34 @@ OutputDevice& FontNameBox::CachePreview(size_t nIndex, 
Point* pTopLeft,
 const FontMetric& rFontMetric = (*mpFontList)[nIndex];
 const OUString& rFontName = rFontMetric.GetFamilyName();
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+// we want to cache only best quality previews
+if (gHighestDPI < nDPIX || gHighestDPI < nDPIY)
+{
+clearRenderedFontNames();
+clearFontPreviewVirDevs();
+gHighestDPI = std::max(nDPIX, nDPIY);
+}
+else if (gHighestDPI > nDPIX || gHighestDPI > nDPIY)
+{
+nDPIX = gHighestDPI;
+nDPIY = gHighestDPI;
+}
+}
+
 size_t nPreviewIndex;
-auto xFind = std::find(gRenderedFontNames.begin(), 
gRenderedFontNames.end(), rFontName);
-bool bPreviewAvailable = xFind != gRenderedFontNames.end();
+auto& rFontNames = getRenderedFontNames();
+auto& rVirtualDevs = getFontPreviewVirDevs();
+auto xFind = std::find(rFontNames.begin(), rFontNames.end(), rFontName);
+bool bPreviewAvailable = xFind != rFontNames.end();
 if (!bPreviewAvailable)
 {
-nPreviewIndex = gRenderedFontNames.size();
-gRenderedFontNames.push_back(rFontName);
+nPreviewIndex = rFontNames.size();
+rFontNames.push_back(rFontName);
 }
 else
-nPreviewIndex = std::distance(gRenderedFontNames.begin(), xFind);
+nPreviewIndex = std::distance(rFontNames.begin(), xFind);
 
 size_t nPage = nPreviewIndex / gPreviewsPerDevice;
 size_t nIndexInPage = nPreviewIndex - (nPage * gPreviewsPerDevice);
@@ -787,15 +827,15 @@ OutputDevice& FontNameBox::CachePreview(size_t nIndex, 
Point* pTopLeft,
 
 if (!bPreviewAvailable)
 {
-if (nPage >= gFontPreviewVirDevs.size())
+if (nPage >= rVirtualDevs.size())
 {
 bool bIsLOK = comphelper::LibreOfficeKit::isActive();
 if (bIsLOK) // allow transparent background in LOK case
-

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

2023-10-07 Thread Szymon Kłos (via logerrit)
 svtools/source/control/ctrlbox.cxx |2 +-
 svx/source/tbxctrls/tbcontrl.cxx   |3 ++-
 vcl/jsdialog/enabled.cxx   |5 -
 3 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 664a8658f720a7d784d717416170ca3d4b2498ad
Author: Szymon Kłos 
AuthorDate: Tue Aug 8 06:48:10 2023 +0200
Commit: Szymon Kłos 
CommitDate: Sat Oct 7 17:04:56 2023 +0200

jsdialog: enable font name & size combobox

This enables font selector with font rendering in Online

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 5c24d36e6607..e5b0883ad87e 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -510,7 +510,7 @@ static bool IsRunningUnitTest() { return 
getenv("LO_TESTNAME") != nullptr; }
 
 void FontNameBox::EnableWYSIWYG(bool bEnable)
 {
-if (comphelper::LibreOfficeKit::isActive() || IsRunningUnitTest())
+if (IsRunningUnitTest())
 return;
 if (mbWYSIWYG == bEnable)
 return;
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 9fdb74a73c21..94bfef34f44d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1740,7 +1741,7 @@ 
SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget
 
 SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const 
Reference& rFrame,
  SvxFontNameToolBoxControl& rCtrl)
-: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox")
+: InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox", true, 
reinterpret_cast(SfxViewShell::Current()))
 , SvxFontNameBox_Base(m_xBuilder->weld_combo_box("fontnamecombobox"), 
rFrame, rCtrl)
 {
 set_id("fontnamecombobox");
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index db4bd04f9f46..13d45dd06849 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -371,7 +371,10 @@ bool isBuilderEnabledForSidebar(std::u16string_view 
rUIFile)
 
 bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile)
 {
-if (rUIFile == u"modules/scalc/ui/numberbox.ui" || rUIFile == 
u"svx/ui/stylespreview.ui")
+if (rUIFile == u"modules/scalc/ui/numberbox.ui"
+|| rUIFile == u"svx/ui/fontnamebox.ui"
+|| rUIFile == u"svx/ui/fontsizebox.ui"
+|| rUIFile == u"svx/ui/stylespreview.ui")
 {
 return true;
 }


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

2023-10-03 Thread Noel Grandin (via logerrit)
 svtools/source/config/miscopt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d95f58a1ebf2ff7fb163cd423df16b4a6167a8fa
Author: Noel Grandin 
AuthorDate: Mon Oct 2 21:12:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 3 10:53:46 2023 +0200

tdf#156756 Icon sizes for the toolbar wrong (part2)

my previous fix
commit 715a6ea8cb3aa6c80edbb22909aac3f18b7daec6
Author: Noel Grandin 
Date:   Mon Oct 2 11:31:09 2023 +0200
tdf#156756 Icon sizes for the toolbar wrong
had a bug which broke changing themes

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

diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index 725654602d1d..fe9788eee14b 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -296,7 +296,7 @@ void SvtMiscOptions_Impl::ImplCommit()
 else {
 value = GetIconTheme();
 }
-seqValuesRange[1] <<= value;
+seqValuesRange[0] <<= value;
 // Set properties in configuration.
 PutProperties( seqNames, seqValues );
 }


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

2023-10-02 Thread Noel Grandin (via logerrit)
 svtools/source/config/miscopt.cxx |   86 +-
 1 file changed, 22 insertions(+), 64 deletions(-)

New commits:
commit 715a6ea8cb3aa6c80edbb22909aac3f18b7daec6
Author: Noel Grandin 
AuthorDate: Mon Oct 2 11:31:09 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 2 13:41:06 2023 +0200

tdf#156756 Icon sizes for the toolbar wrong

So my change in
commit 0558926c2f9201a12b4c46efc36b8a4080af4d46
Author: Noel Grandin 
Date:   Tue Jun 6 10:42:10 2023 +0200
use more officecfg for SvtMiscOptions

Made an existing bug much worse.

The underlying bug started in
commit fd92b09db497a7dfd594a5418f87856dc3886bf9
Author: Caolán McNamara 
Date:   Tue Feb 14 13:12:38 2023 +
tdf#153541 notify listeners when any of the icon sizes change

which resulted in changes to icon sizes not being saved to the registry,
because the registry layer would throw an exception when called from
SvtMiscOptions_Impl::ImplCommit, because it does not like being passed
null values for SidebarIconSize and NotebookbarIconSize properties.

So I have done two things
(1) finish removing handling of SymbolSet from the SvtMiscOptions_Impl
code, and just use the officecfg:: layer.
(2) Change the ImplCommit code to only pass down properties for which it
actually has valid values.

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

diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index f09d07feabed..725654602d1d 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -45,7 +45,6 @@ constexpr OUStringLiteral ROOTNODE_MISC = 
u"Office.Common/Misc";
 
 // PROPERTYHANDLE defines must be sequential from zero for Commit/Load
 constexpr OUStringLiteral PROPERTYNAME_SYMBOLSET = u"SymbolSet";
-#define PROPERTYHANDLE_SYMBOLSET0
 constexpr OUStringLiteral PROPERTYNAME_ICONTHEME = u"SymbolStyle";
 #define PROPERTYHANDLE_SYMBOLSTYLE  1
 constexpr OUStringLiteral PROPERTYNAME_SIDEBARICONSIZE = u"SidebarIconSize";
@@ -62,8 +61,6 @@ class SvtMiscOptions_Impl : public ConfigItem
 {
 private:
 ::std::vector> aList;
-sal_Int16   m_nSymbolsSize;
-boolm_bIsSymbolsSizeRO;
 boolm_bIsSymbolsStyleRO;
 boolm_bIconThemeWasSetAutomatically;
 
@@ -95,8 +92,6 @@ public:
 
 //  public interface
 
-void SetSymbolsSize( sal_Int16 nSet );
-
 static OUString GetIconTheme();
 
 enum class SetModifiedFlag { SET, DONT_SET };
@@ -146,8 +141,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
 // Init baseclasses first
 : ConfigItem( ROOTNODE_MISC )
 
-, m_nSymbolsSize( 0 )
-, m_bIsSymbolsSizeRO( false )
 , m_bIsSymbolsStyleRO( false )
 , m_bIconThemeWasSetAutomatically( false )
 {
@@ -170,16 +163,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
 continue;
 switch( nProperty )
 {
-case PROPERTYHANDLE_SYMBOLSET :
-{
-if( !(seqValues[nProperty] >>= m_nSymbolsSize) )
-{
-OSL_FAIL("Wrong type of \"Misc\\SymbolSet\"!" );
-}
-m_bIsSymbolsSizeRO = seqRO[nProperty];
-break;
-}
-
 case PROPERTYHANDLE_SYMBOLSTYLE :
 {
 OUString aIconTheme;
@@ -226,13 +209,6 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString 
>& rPropertyNames )
 continue;
 switch( comphelper::findValue(aInternalPropertyNames, 
rPropertyNames[nProperty]) )
 {
-case PROPERTYHANDLE_SYMBOLSET   :   {
-if( 
!(seqValues[nProperty] >>= m_nSymbolsSize) )
-{
-
OSL_FAIL("Wrong type of \"Misc\\SymbolSet\"!" );
-}
-}
-break;
 case PROPERTYHANDLE_SYMBOLSTYLE :   {
 OUString 
aIconTheme;
 if 
(seqValues[nProperty] >>= aIconTheme)
@@ -261,13 +237,6 @@ void SvtMiscOptions_Impl::CallListeners()
 elem.Call( nullptr );
 }
 
-void SvtMiscOptions_Impl::SetSymbolsSize( sal_Int16 nSet )
-{
-m_nSymbolsSize = nSet;
-SetModified();
-CallListeners();
-}
-
 OUString SvtMiscOptions_Impl::GetIconTheme()
 {
 return Application::GetSettings().GetStyleSettings().DetermineIconTheme();
@@ -313,41 +282,24 @@ void 

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

2023-09-11 Thread Noel Grandin (via logerrit)
 svtools/source/control/accessibleruler.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8d98273dab1a31243801614ec4b07ac7f2e46349
Author: Noel Grandin 
AuthorDate: Sun Sep 10 16:51:58 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 11 12:05:52 2023 +0200

SvtRulerAccessible does not need to implement XAggreggation

Checked on jenkins using 'make check' and

+void SAL_CALL setDelegator(css::uno::Reference const 
&) final { assert(false); }

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

diff --git a/svtools/source/control/accessibleruler.hxx 
b/svtools/source/control/accessibleruler.hxx
index 1eb4ad77d541..ba03d0843a2b 100644
--- a/svtools/source/control/accessibleruler.hxx
+++ b/svtools/source/control/accessibleruler.hxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -35,7 +35,7 @@ namespace tools { class Rectangle; }
 class Ruler;
 
 
-typedef ::cppu::WeakAggComponentImplHelper5<
+typedef ::cppu::WeakComponentImplHelper<
 css::accessibility::XAccessible,
 css::accessibility::XAccessibleComponent,
 css::accessibility::XAccessibleContext,


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

2023-09-11 Thread Szymon Kłos (via logerrit)
 svtools/source/control/ctrlbox.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 1d50bbc8df0b9b1cad16bccc835f1aecfdf2abfb
Author: Szymon Kłos 
AuthorDate: Fri Aug 25 18:01:54 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon Sep 11 09:59:23 2023 +0200

lok: don't prerender font previews

Change-Id: Id83a6804f658d56793913b8e8e07f7ec1f2ff82a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156116
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156812
Tested-by: Jenkins

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 40dd39b0d289..5c24d36e6607 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -571,6 +571,9 @@ namespace
 
 IMPL_LINK_NOARG(FontNameBox, UpdateHdl, Timer*, void)
 {
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 CachePreview(mnPreviewProgress++, nullptr);
 // tdf#132536 limit to ~25 pre-rendered for now. The font caches look
 // b0rked, the massive charmaps are ~never swapped out, and don't count


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

2023-09-09 Thread Michael Weghorn (via logerrit)
 svtools/source/control/valueacc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7737dab14baea000810965c572f06a10a94f73df
Author: Michael Weghorn 
AuthorDate: Sat Sep 9 22:22:09 2023 +0300
Commit: Michael Weghorn 
CommitDate: Sun Sep 10 07:09:14 2023 +0200

tdf#157160 a11y: Don't assert ValueSetAcc parent on add/remove

After

commit 2f5e7a07775690e57d639eeca7a1e41733fa93a9
Author: Michael Weghorn 
Date:   Thu Sep 7 08:09:31 2023 +0200

tdf#157092 a11y Let only drawing area dispose its ValueSet acc

had fixed a crash when using the search feature with the Qt-based
VCL plugins, the previous `DBG_ASSERT` that got promoted to a
real assert with the above commit got triggered now that a11y CHILD
events for removed children are handled since

commit be8b031d8b3c66b223ea2478f1129427f3a362bd
Author: Michael Weghorn 
Date:   Thu Sep 7 09:51:38 2023 +0200

qt a11y: Forward CHILD event for removed child

, s. the backtrace in tdf#157160.

Since the ValueSet isn't needed for this, and at least removing
a listener after the ValueSet has been dropped even seems logical if it's
a valid use case to delete the ValueSet before e.g. hiding the
window (s.a. comment in above-mentioned
2f5e7a07775690e57d639eeca7a1e41733fa93a9), don't check for it,
but only that the object hasn't been disposed yet
(as was effectively the case before
2f5e7a07775690e57d639eeca7a1e41733fa93a9, when
only a SAL_WARN would have been triggered).

Change-Id: I5be0a44decbe4508f4a419ec3dca9f8aaf85e951
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156782
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 2f897ae015ce..57c1777d4800 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -632,7 +632,7 @@ lang::Locale SAL_CALL ValueSetAcc::getLocale()
 
 void SAL_CALL ValueSetAcc::addAccessibleEventListener( const uno::Reference< 
accessibility::XAccessibleEventListener >& rxListener )
 {
-ThrowIfDisposed();
+ThrowIfDisposed(false);
 std::unique_lock aGuard (m_aMutex);
 
 if( !rxListener.is() )
@@ -656,7 +656,7 @@ void SAL_CALL ValueSetAcc::addAccessibleEventListener( 
const uno::Reference< acc
 
 void SAL_CALL ValueSetAcc::removeAccessibleEventListener( const 
uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
 {
-ThrowIfDisposed();
+ThrowIfDisposed(false);
 std::unique_lock aGuard (m_aMutex);
 
 if( rxListener.is() )


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

2023-09-07 Thread Michael Weghorn (via logerrit)
 svtools/source/control/valueacc.cxx |   20 
 svtools/source/control/valueimp.hxx |8 +++-
 svtools/source/control/valueset.cxx |2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

New commits:
commit 2f5e7a07775690e57d639eeca7a1e41733fa93a9
Author: Michael Weghorn 
AuthorDate: Thu Sep 7 08:09:31 2023 +0200
Commit: Michael Weghorn 
CommitDate: Thu Sep 7 13:13:18 2023 +0200

tdf#157092 a11y Let only drawing area dispose its ValueSet acc

Don't dispose the a11y object in the `ValueSet` dtor, because it
doesn't own its a11y object, but it is owned by the `weld::DrawingArea`
of the `CustomWeld` that the `ValueSet` (as a sub-class of
`CustomWidgetController`) belongs to.

The `CustomWeld` ctor passes the a11y ref retrieved by
`CustomWidgetController::createAccessible` to `weld_drawing_area`,
which takes ownership and disposes the object.
(For Gtk, see  `GtkInstanceDrawingArea::~GtkInstanceDrawingArea`.
For non-Gtk, see how the `SalInstanceDrawingArea` ctor
passes the reference to `VclInstanceDrawingArea::SetAccessible`/
`vcl::Window::SetAccessible`, so it gets disposed when that
`VclInstanceDrawingArea` gets disposed, s. `vcl::Window::dispose`.)

Other classes derived from `CustomWidgetController`
also don't dispose the a11y object themselves.

Still reset the `ValueSet` pointer in `ValueSetAcc` to
nullptr when the `ValueSet` gets destroyed and turn the
check for a valid pointer from just an `OSL_ASSERT`
to a real assert and throwing a `RuntimeException`.
But still allow getting the a11y context when only
the ValueSet has been deleted but the object has not
been disposed yet.

Fixes a crash due to a `com::sun::star::lang::DisposedException`
being thrown when using the new search feature in the "Tools" ->
"Options" dialog (or when just switching to the "LibreOfficeDev
Writer/Web" -> "Background" page with the qt6 VCL plugin or
on Windows when the NVDA screen reader is running.

This happens when the drawing area is hidden and the a11y layer
is meant to be notified about this (so the a11y object can be
removed).

It still seems a bit odd that the `ValueSet` gets destroyed
(in `SvxColorTabPage::~SvxColorTabPage`, frame 20 in below backtrace)
before the corresponding `vcl::Window` gets hidden (in the base
class dtor, `SfxTabPage::~SfxTabPage`, s. frame 19 in the backtrace).

Backtrace for how the exception gets thrown:

1   com::sun::star::lang::DisposedException::DisposedException  
 DisposedException.hpp   40   0x7fa385fd9ca9
2   ValueSetAcc::ThrowIfDisposed
 valueacc.cxx956  0x7fa385fd9342
3   ValueSetAcc::getAccessibleContext   
 valueacc.cxx473  0x7fa385fd69fa
4   VCLXAccessibleComponent::ProcessWindowChildEvent
 vclxaccessiblecomponent.cxx 186  0x7fa3853dc905
5   VCLXAccessibleComponent::WindowChildEventListener   
 vclxaccessiblecomponent.cxx 124  0x7fa3853dc51d
6   VCLXAccessibleComponent::LinkStubWindowChildEventListener   
 vclxaccessiblecomponent.cxx 114  0x7fa3853dc43f
7   Link::Call   
 link.hxx111  0x7fa382c56ccf
8   vcl::Window::CallEventListeners 
 event.cxx   296  0x7fa382c53e5b
9   vcl::Window::ImplResetReallyVisible 
 stacking.cxx719  0x7fa382b51a49
10  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
11  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
12  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
13  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
14  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
15  vcl::Window::ImplResetReallyVisible 
 stacking.cxx735  0x7fa382b51b0e
16  vcl::Window::Show   
 window.cxx  2234 0x7fa382d94f7c
17  vcl::Window::Hide   
 window.hxx  880  0x7fa382b23600
18  SalInstanceContainer::move  
 salvtables.cxx  1352 0x7fa3834789f3
19  SfxTabPage::~SfxTabPage 

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

2023-09-03 Thread Julien Nabet (via logerrit)
 svtools/source/control/tabbar.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a853af876ff59733c60f205c0cdbc240c10f01a0
Author: Julien Nabet 
AuthorDate: Sun Sep 3 14:57:06 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Sep 3 16:11:27 2023 +0200

tdf#156958: fix crash when clicking out after having selected rename layer

When renaming and clicking on canvas, LO goes into GetParent()->EndEditMode 
first time
then it calls TabBarEdit::dispose method which resets m_xEntry BUT, on the 
same thread, LO comes here again
so return if already disposed to avoid a crash

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

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

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index ddadf400761d..1690269ba234 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -404,6 +404,12 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel, 
void )
 ResetPostEvent();
 maLoseFocusIdle.Stop();
 
+// tdf#156958: when renaming and clicking on canvas, LO goes into 
GetParent()->EndEditMode first time
+// then it calls TabBarEdit::dispose method which resets m_xEntry BUT, on 
the same thread, LO comes here again
+// so return if already disposed to avoid a crash
+if (isDisposed())
+return;
+
 // We need this query, because the edit gets a losefocus event,
 // when it shows the context menu or the insert symbol dialog
 if (!m_xEntry->has_focus() && m_xEntry->has_child_focus())


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

2023-08-29 Thread Szymon Kłos (via logerrit)
 svtools/source/control/ctrlbox.cxx |5 -
 vcl/jsdialog/jsdialogbuilder.cxx   |2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit f232b5945151e911db1e37c64e38ca1ed2c95854
Author: Szymon Kłos 
AuthorDate: Thu Aug 24 10:54:28 2023 +0200
Commit: Szymon Kłos 
CommitDate: Tue Aug 29 15:15:29 2023 +0200

jsdialog: make font previews background transparent

Change-Id: I9dc75ab91f591191be7a354274a0783b0fd093b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156029
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156244
Tested-by: Jenkins

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index b33051f7c911..f07041f4a423 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -777,7 +777,10 @@ OutputDevice& FontNameBox::CachePreview(size_t nIndex, 
Point* pTopLeft)
 {
 if (nPage >= gFontPreviewVirDevs.size())
 {
-
gFontPreviewVirDevs.emplace_back(m_xComboBox->create_render_virtual_device());
+if (comphelper::LibreOfficeKit::isActive())
+
gFontPreviewVirDevs.emplace_back(VclPtr::Create(DeviceFormat::WITH_ALPHA));
+else
+
gFontPreviewVirDevs.emplace_back(m_xComboBox->create_render_virtual_device());
 VirtualDevice& rDevice = *gFontPreviewVirDevs.back();
 rDevice.SetOutputSizePixel(Size(gUserItemSz.Width(), 
gUserItemSz.Height() * gPreviewsPerDevice));
 weld::SetPointFont(rDevice, m_xComboBox->get_font());
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 997cf90d45bf..2e0fc28e544b 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1663,7 +1663,7 @@ bool JSComboBox::changed_by_direct_pick() const { return 
true; }
 
 void JSComboBox::render_entry(int pos)
 {
-ScopedVclPtrInstance pDevice;
+ScopedVclPtrInstance pDevice(DeviceFormat::WITH_ALPHA);
 Size aRenderSize = signal_custom_get_size(*pDevice);
 pDevice->SetOutputSize(aRenderSize);
 


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

2023-08-24 Thread Noel Grandin (via logerrit)
 svtools/source/config/accessibilityoptions.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bff6a734dd4c2d5572a10f39a3a8dd5313c2278a
Author: Noel Grandin 
AuthorDate: Wed Aug 23 12:50:47 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 24 09:53:26 2023 +0200

tdf#156847 Transparency in drop-down lists Line and Width on Sidebar

regression from
commit 1527fa8435ef415678b2e4a6972f5e378ee5cab1
Author: Noel Grandin 
Date:   Tue Jun 6 11:20:17 2023 +0200
convert SvtAccessibilityOptions to officecfg where possible
where the method call returns a std::optional which is translated
to a bool, resulting a true value from an optional

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

diff --git a/svtools/source/config/accessibilityoptions.cxx 
b/svtools/source/config/accessibilityoptions.cxx
index 1afe6113f297..460354cae319 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -146,7 +146,8 @@ void SvtAccessibilityOptions::SetVCLSettings()
 StyleSettingsChanged = true;
 }
 
-const bool 
bPreviewUsesCheckeredBackground(officecfg::Office::Common::Accessibility::PreviewUsesCheckeredBackground::get());
+std::optional bTmp = 
officecfg::Office::Common::Accessibility::PreviewUsesCheckeredBackground::get();
+const bool bPreviewUsesCheckeredBackground = bTmp.value_or(false);
 
 if(aStyleSettings.GetPreviewUsesCheckeredBackground() != 
bPreviewUsesCheckeredBackground)
 {


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

2023-06-12 Thread Mike Kaganski (via logerrit)
 svtools/source/misc/unitconv.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cf0fe26f95b5435d65623165cf7ba381eaa0738a
Author: Mike Kaganski 
AuthorDate: Mon Jun 12 12:23:17 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Jun 12 12:58:51 2023 +0200

tdf#154349: round before converting to an integer

Commit cfff893b9c82843a90aac4ecdb3a3936721b74a0 (Move unit conversion
code to o3tl, and unify on that in more places, 2021-02-14) changed a
custom conversion code in CalcToUnit doing inexact conversion from
points to mm/20 (with "* 10 / 567"), with correct conversion function.
A side effect was, however, that the imprecise arithmetics provided
floating-point values that rounded down to correct integers (or maybe
it was all the chain of calculations down to this function), while
the correctly converted values could round down to a smaller value.

Fix this problem using rounding.

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

diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx
index 395c1b4ac810..cb4fdf6901dd 100644
--- a/svtools/source/misc/unitconv.cxx
+++ b/svtools/source/misc/unitconv.cxx
@@ -128,7 +128,7 @@ tools::Long CalcToUnit( float nIn, MapUnit eUnit )
 eUnit == MapUnit::MapCM, "this unit is not implemented" );
 
 if (const auto eTo = MapToO3tlLength(eUnit); eTo != o3tl::Length::invalid)
-return o3tl::convert(nIn, o3tl::Length::pt, eTo);
+return std::round(o3tl::convert(nIn, o3tl::Length::pt, eTo));
 
 return 0;
 }


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

2023-05-28 Thread Khaled Hosny (via logerrit)
 svtools/source/misc/sampletext.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit da09513ae6221f46ee453943b3669d1d922a4aa3
Author: Khaled Hosny 
AuthorDate: Sun May 28 13:06:42 2023 +0300
Commit: خالد حسني 
CommitDate: Sun May 28 13:07:46 2023 +0200

tdf#154547: Improve Hebrew font preview sample text

The Hebrew font preview sample text include Nikkud (vowel marks) which
are optional for modern Hebrew and not all Hebrew fonts have them, and
for fonts lacking them we use a much shorter preview text.

The inclusion of Nikkud is unnecessary and we don’t include vowel marks
in many other scripts (e.g. Arabic where they are more used).

This patch drop the Nikkud marks and leaves the sample text otherwise
unchanged.

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

diff --git a/svtools/source/misc/sampletext.cxx 
b/svtools/source/misc/sampletext.cxx
index abcfde92b7a1..9000f6f73d6c 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -232,9 +232,8 @@ OUString makeShortRepresentativeTextForScript(UScriptCode 
eScript)
 case USCRIPT_HEBREW:
 {
 static constexpr OUStringLiteral aHebr =
-u"\u05D0\u05B8\u05DC\u05B6\u05E3\u05BE\u05D1\u05B5"
-"\u05BC\u05D9\u05EA \u05E2\u05B4\u05D1\u05B0"
-"\u05E8\u05B4\u05D9";
+u"\u05D0\u05DC\u05E3\u05BE\u05D1\u05D9\u05EA "
+"\u05E2\u05D1\u05E8\u05D9";
 sSampleText = aHebr;
 break;
 }


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

2023-05-23 Thread Noel Grandin (via logerrit)
 svtools/source/control/valueacc.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6a55299234da6df8bfba760223af30625ac32288
Author: Noel Grandin 
AuthorDate: Mon May 22 08:39:30 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue May 23 18:53:41 2023 +0200

prevent some "index hint out of range" warnings

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

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index a14676d403fa..cdf759621042 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -421,6 +421,7 @@ void ValueSetAcc::FireAccessibleEvent( short nEventId, 
const uno::Any& rOldValue
 aEvtObject.Source = getXWeak();
 aEvtObject.NewValue = rNewValue;
 aEvtObject.OldValue = rOldValue;
+aEvtObject.IndexHint = -1;
 
 for (auto const& tmpListener : aTmpListeners)
 {


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

2023-05-05 Thread Mike Kaganski (via logerrit)
 svtools/source/control/valueacc.cxx |6 +++---
 svtools/source/control/valueset.cxx |4 ++--
 svtools/source/uno/unoimap.cxx  |   10 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 6276e7c28ed53670fb911ec2bd97a6696583d36b
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:01 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 6 07:25:32 2023 +0200

Use getXWeak in svtools

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

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 1ba2c79dbbab..a14676d403fa 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -387,7 +387,7 @@ void ValueItemAcc::FireAccessibleEvent( short nEventId, 
const uno::Any& rOldValu
 accessibility::AccessibleEventObject   
 aEvtObject;
 
 aEvtObject.EventId = nEventId;
-aEvtObject.Source = static_cast(this);
+aEvtObject.Source = getXWeak();
 aEvtObject.NewValue = rNewValue;
 aEvtObject.OldValue = rOldValue;
 
@@ -418,7 +418,7 @@ void ValueSetAcc::FireAccessibleEvent( short nEventId, 
const uno::Any& rOldValue
 accessibility::AccessibleEventObject   
 aEvtObject;
 
 aEvtObject.EventId = nEventId;
-aEvtObject.Source = static_cast(this);
+aEvtObject.Source = getXWeak();
 aEvtObject.NewValue = rNewValue;
 aEvtObject.OldValue = rOldValue;
 
@@ -952,7 +952,7 @@ void ValueSetAcc::ThrowIfDisposed()
 SAL_WARN("svx", "Calling disposed object. Throwing exception:");
 throw lang::DisposedException (
 "object has been already disposed",
-static_cast(this));
+getXWeak());
 }
 else
 {
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 76bce45c8de3..933f8d42ca49 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -804,7 +804,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 {
 Any aOldAny;
 Any aNewAny;
-aOldAny <<= 
Reference(static_cast(pItemAcc));
+aOldAny <<= Reference(getXWeak(pItemAcc));
 
ImplFireAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, 
aNewAny );
 }
 }
@@ -827,7 +827,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 {
 Any aOldAny;
 Any aNewAny;
-aNewAny <<= 
Reference(static_cast(pItemAcc));
+aNewAny <<= Reference(getXWeak(pItemAcc));
 ImplFireAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, 
aOldAny, aNewAny);
 }
 
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 64d7521fc63b..210e580818c0 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -671,27 +671,27 @@ void SvUnoImageMap::fillImageMap( ImageMap& rMap ) const
 
 Reference< XInterface > SvUnoImageMapRectangleObject_createInstance( const 
SvEventDescription* pSupportedMacroItems )
 {
-return static_cast(new SvUnoImageMapObject( 
IMapObjectType::Rectangle, pSupportedMacroItems ));
+return getXWeak(new SvUnoImageMapObject( IMapObjectType::Rectangle, 
pSupportedMacroItems ));
 }
 
 Reference< XInterface > SvUnoImageMapCircleObject_createInstance( const 
SvEventDescription* pSupportedMacroItems )
 {
-return static_cast(new SvUnoImageMapObject( 
IMapObjectType::Circle, pSupportedMacroItems ));
+return getXWeak(new SvUnoImageMapObject( IMapObjectType::Circle, 
pSupportedMacroItems ));
 }
 
 Reference< XInterface > SvUnoImageMapPolygonObject_createInstance( const 
SvEventDescription* pSupportedMacroItems )
 {
-return static_cast(new SvUnoImageMapObject( 
IMapObjectType::Polygon, pSupportedMacroItems ));
+return getXWeak(new SvUnoImageMapObject( IMapObjectType::Polygon, 
pSupportedMacroItems ));
 }
 
 Reference< XInterface > SvUnoImageMap_createInstance()
 {
-return static_cast(new SvUnoImageMap);
+return getXWeak(new SvUnoImageMap);
 }
 
 Reference< XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, 
const SvEventDescription* pSupportedMacroItems )
 {
-return static_cast(new SvUnoImageMap( rMap, pSupportedMacroItems 
));
+return getXWeak(new SvUnoImageMap( rMap, pSupportedMacroItems ));
 }
 
 bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, 
ImageMap& rMap )


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

2023-04-17 Thread Heiko Tietze (via logerrit)
 svtools/source/config/colorcfg.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 846e9a202b450445ede565c4f6a9a70954134438
Author: Heiko Tietze 
AuthorDate: Wed Apr 12 15:12:33 2023 +0200
Commit: Caolán McNamara 
CommitDate: Mon Apr 17 12:50:46 2023 +0200

Resolves tdf#152184 - App color follow system colors

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

diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 3fa88a3886cf..4847aeb6bd7d 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "itemholder2.hxx"
 
@@ -443,10 +444,14 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry 
eEntry)
 default:
 int nAppMod;
 switch (MiscSettings::GetAppColorMode()) {
-case 0: nAppMod = clLight; break; // UseDarkMode() ? clDark : 
clLight; break;
+default:
+if (MiscSettings::GetUseDarkMode())
+nAppMod = clDark;
+else
+nAppMod = clLight;
+break;
 case 1: nAppMod = clLight; break;
 case 2: nAppMod = clDark; break;
-default: nAppMod = clLight;
 }
 aRet = cAutoColors[eEntry][nAppMod];
 }


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

2023-03-22 Thread Heiko Tietze (via logerrit)
 svtools/source/misc/imagemgr.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 1ff8fa39d116c856dd2c0a6809a7f2f100b3439e
Author: Heiko Tietze 
AuthorDate: Tue Mar 14 11:53:54 2023 +0100
Commit: Heiko Tietze 
CommitDate: Wed Mar 22 13:54:38 2023 +

Related tdf#154182 - Recognize flat open document formats in MRU list

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

diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 7dc6705da29d..4c0d31ef3eb3 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -101,11 +101,15 @@ SvtExtensionResIdMapping_Impl const ExtensionMap_Impl[] =
 { "mod",   true,  STR_DESCRIPTION_SOURCEFILE,SvImageId::NONE },
 { "odb",   false, STR_DESCRIPTION_OO_DATABASE_DOC,   
SvImageId::OO_DatabaseDoc },
 { "odg",   false, STR_DESCRIPTION_OO_DRAW_DOC,   
SvImageId::OO_DrawDoc },
+{ "fodg",  false, STR_DESCRIPTION_OO_DRAW_DOC,   
SvImageId::OO_DrawDoc },
 { "odf",   false, STR_DESCRIPTION_OO_MATH_DOC,   
SvImageId::OO_MathDoc },
 { "odm",   false, STR_DESCRIPTION_OO_GLOBAL_DOC, 
SvImageId::OO_GlobalDoc },
 { "odp",   false, STR_DESCRIPTION_OO_IMPRESS_DOC,
SvImageId::OO_ImpressDoc },
+{ "fodp",  false, STR_DESCRIPTION_OO_IMPRESS_DOC,
SvImageId::OO_ImpressDoc },
 { "ods",   false, STR_DESCRIPTION_OO_CALC_DOC,   
SvImageId::OO_CalcDoc },
+{ "fods",  false, STR_DESCRIPTION_OO_CALC_DOC,   
SvImageId::OO_CalcDoc },
 { "odt",   false, STR_DESCRIPTION_OO_WRITER_DOC, 
SvImageId::OO_WriterDoc },
+{ "fodt",  false, STR_DESCRIPTION_OO_WRITER_DOC, 
SvImageId::OO_WriterDoc },
 { "otg",   false, STR_DESCRIPTION_OO_DRAW_TEMPLATE,  
SvImageId::OO_DrawTemplate },
 { "otp",   false, STR_DESCRIPTION_OO_IMPRESS_TEMPLATE,   
SvImageId::OO_ImpressTemplate },
 { "ots",   false, STR_DESCRIPTION_OO_CALC_TEMPLATE,  
SvImageId::OO_CalcTemplate },


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

2023-03-15 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit ac442dc11247a9f794056cfb7d6cff5cd8400717
Author: Caolán McNamara 
AuthorDate: Tue Mar 14 16:51:24 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 15 10:13:03 2023 +

set the background color of the valueset during format

so that it will change when the theme changes

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 0da10bfda9e2..84bb1248e6e5 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -80,8 +80,6 @@ ValueSet::ValueSet(std::unique_ptr 
pScrolledWindow)
 , mbFormat(true)
 , mbHighlight(false)
 {
-
maVirDev->SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor());
-
 mnItemWidth = 0;
 mnItemHeight= 0;
 mnTextOffset= 0;
@@ -998,6 +996,7 @@ void ValueSet::Format(vcl::RenderContext const & 
rRenderContext)
 
 // Init VirDev
 maVirDev->SetSettings(rRenderContext.GetSettings());
+
maVirDev->SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor());
 maVirDev->SetOutputSizePixel(aWinSize);
 
 // nothing is changed in case of too small items


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

2023-03-02 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit caa1d1ccf39ff8a60b7d89dd53afbf73d3cafeca
Author: Caolán McNamara 
AuthorDate: Thu Mar 2 16:51:41 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 2 20:01:01 2023 +

Resolves: tdf#153787 highlighted entry text overdraws selected entry text

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 96f940555965..0da10bfda9e2 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1515,6 +1515,9 @@ void ValueSet::ImplDrawItemText(vcl::RenderContext& 
rRenderContext, const OUStri
 nTxtOffset += NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
 
 
rRenderContext.SetTextColor(Application::GetSettings().GetStyleSettings().GetButtonTextColor());
+// tdf#153787 highlighted entry text is drawn in the same Paint as the 
selected text, so can
+// overwrite already rendered text
+rRenderContext.Erase(tools::Rectangle(Point(0, nTxtOffset), 
Point(aWinSize.Width(), aWinSize.Height(;
 rRenderContext.DrawText(Point((aWinSize.Width() - nTxtWidth) / 2, 
nTxtOffset + (NAME_OFFSET / 2)), rText);
 
 rRenderContext.Pop();


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

2023-02-21 Thread Caolán McNamara (via logerrit)
 svtools/source/uno/wizard/wizardpagecontroller.cxx |   18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

New commits:
commit b428a97d88b08fadd63039482c09c17a5fbac3be
Author: Caolán McNamara 
AuthorDate: Tue Feb 21 10:27:39 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 21 13:27:54 2023 +

Related: tdf#152508 and tdf#132110 use initial child size as size request

tdf#132110 works with this, and might be a better solution for tdf#152508
which doesn't have an explicit reproducer, but describes a similar
problem.

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

diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx 
b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 57ed08c6f164..67776a38e937 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -51,25 +51,13 @@ namespace svt::uno
 {
 // Plug a toplevel SalFrame into the native page which can host 
our awt widgetry
 css::uno::Reference xChildFrame = 
pParent->CreateChildFrame();
-com::sun::star::awt::Rectangle r0 = xChildFrame->getPosSize();
 m_xWizardPage.set(m_xController->createPage(xChildFrame, 
i_nPageId), UNO_SET_THROW);
 
 css::uno::Reference 
xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW);
 
-// If size of page is changed by createPage, then the requested 
size of the container
-// should also be set to this size, to avoid annoying resizings.
-com::sun::star::awt::Rectangle r1 = xChildFrame->getPosSize();
-
-if (r0.Width != r1.Width || r0.Height != r1.Height)
-pParent->set_size_request(r1.Width, r1.Height);
-else
-{
-// tdf#132110 If the parent size wasn't overridden, then use
-// the size of the child if that was set
-com::sun::star::awt::Rectangle aChildRect = 
xPageWindow->getPosSize();
-if (aChildRect.Width && aChildRect.Height)
-pParent->set_size_request(aChildRect.Width, 
aChildRect.Height);
-}
+// tdf#132110 use the current size of the child as the size request
+com::sun::star::awt::Rectangle aChildRect = 
xPageWindow->getPosSize();
+pParent->set_size_request(aChildRect.Width, aChildRect.Height);
 
 xPageWindow->setVisible(true);
 }


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

2023-02-21 Thread Caolán McNamara (via logerrit)
 svtools/source/uno/wizard/wizardpagecontroller.cxx |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 9c978e4c75e342b2345ff4fcbd1b5751627d8baf
Author: Caolán McNamara 
AuthorDate: Tue Feb 21 09:59:31 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 21 11:55:29 2023 +

Related: tdf#132110 use the container child size as default size

if the container size wasn't changed

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

diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx 
b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 850d9b102c7a..57ed08c6f164 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -51,18 +51,27 @@ namespace svt::uno
 {
 // Plug a toplevel SalFrame into the native page which can host 
our awt widgetry
 css::uno::Reference xChildFrame = 
pParent->CreateChildFrame();
-// If size of page is changed by createPage, then the requested 
size of the container
-// should also be set to this size, to avoid annoying resizings.
 com::sun::star::awt::Rectangle r0 = xChildFrame->getPosSize();
 m_xWizardPage.set(m_xController->createPage(xChildFrame, 
i_nPageId), UNO_SET_THROW);
+
+css::uno::Reference 
xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW);
+
+// If size of page is changed by createPage, then the requested 
size of the container
+// should also be set to this size, to avoid annoying resizings.
 com::sun::star::awt::Rectangle r1 = xChildFrame->getPosSize();
+
 if (r0.Width != r1.Width || r0.Height != r1.Height)
-{
 pParent->set_size_request(r1.Width, r1.Height);
+else
+{
+// tdf#132110 If the parent size wasn't overridden, then use
+// the size of the child if that was set
+com::sun::star::awt::Rectangle aChildRect = 
xPageWindow->getPosSize();
+if (aChildRect.Width && aChildRect.Height)
+pParent->set_size_request(aChildRect.Width, 
aChildRect.Height);
 }
 
-Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), 
UNO_SET_THROW);
-xPageWindow->setVisible( true );
+xPageWindow->setVisible(true);
 }
 catch( const Exception& )
 {


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

2023-02-20 Thread Caolán McNamara (via logerrit)
 svtools/source/control/tabbar.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 816b3607dd9676a343e8ee544b615e75393566d3
Author: Caolán McNamara 
AuthorDate: Mon Feb 20 15:54:22 2023 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 20 21:01:11 2023 +

Resolves: tdf#153763 first/last buttons in tabbar not responding

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

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index a0995eef4910..ddadf400761d 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -884,13 +884,16 @@ void TabBar::ImplShowPage( sal_uInt16 nPos )
 
 IMPL_LINK( TabBar, ImplClickHdl, weld::Button&, rBtn, void )
 {
-if ((GetPointerState().mnState & (MOUSE_LEFT | MOUSE_MIDDLE | 
MOUSE_RIGHT)) == 0)
+if ( != mpImpl->mxButtonBox->m_xFirstButton.get() &&  != 
mpImpl->mxButtonBox->m_xLastButton.get())
 {
-// like tdf#149482 if we didn't see a mouse up, but find that the 
mouse is no
-// longer pressed at this point, then bail
-mpImpl->mxButtonBox->m_xPrevRepeater->Stop();
-mpImpl->mxButtonBox->m_xNextRepeater->Stop();
-return;
+if ((GetPointerState().mnState & (MOUSE_LEFT | MOUSE_MIDDLE | 
MOUSE_RIGHT)) == 0)
+{
+// like tdf#149482 if we didn't see a mouse up, but find that the 
mouse is no
+// longer pressed at this point, then bail
+mpImpl->mxButtonBox->m_xPrevRepeater->Stop();
+mpImpl->mxButtonBox->m_xNextRepeater->Stop();
+return;
+}
 }
 
 EndEditMode();


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

2023-02-15 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |   33 ++---
 1 file changed, 10 insertions(+), 23 deletions(-)

New commits:
commit 0c9f93e9079a60725e6ff62bfc4a6a8a7254680e
Author: Caolán McNamara 
AuthorDate: Wed Feb 15 13:18:06 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Feb 15 16:56:24 2023 +

tdf#153633 color description in chart colors options always black

even in dark mode. There are some other visual glitches here, just
erase the rendercontext before drawing to it.

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 069379779d61..96f940555965 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -255,16 +255,8 @@ IMPL_LINK(ValueSet, ImplScrollHdl, weld::ScrolledWindow&, 
rScrollWin, void)
 
 void ValueSet::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
-if (GetStyle() & WB_FLATVALUESET)
-{
-const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-rRenderContext.SetLineColor();
-rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
-tools::Long nOffY = maVirDev->GetOutputSizePixel().Height();
-Size aWinSize(GetOutputSizePixel());
-rRenderContext.DrawRect(tools::Rectangle(Point(0, nOffY ), Point( 
aWinSize.Width(), aWinSize.Height(;
-}
-
+
rRenderContext.SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor());
+rRenderContext.Erase();
 ImplDraw(rRenderContext);
 }
 
@@ -1515,22 +1507,17 @@ void ValueSet::ImplDrawItemText(vcl::RenderContext& 
rRenderContext, const OUStri
 tools::Long nTxtWidth = rRenderContext.GetTextWidth(rText);
 tools::Long nTxtOffset = mnTextOffset;
 
+rRenderContext.Push(vcl::PushFlags::TEXTCOLOR);
+
 // delete rectangle and show text
-if (GetStyle() & WB_FLATVALUESET)
-{
-const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-rRenderContext.SetLineColor();
-rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
-rRenderContext.DrawRect(tools::Rectangle(Point(0, nTxtOffset), 
Point(aWinSize.Width(), aWinSize.Height(;
-rRenderContext.SetTextColor(rStyleSettings.GetButtonTextColor());
-}
-else
-{
+const bool bFlat(GetStyle() & WB_FLATVALUESET);
+if (!bFlat)
 nTxtOffset += NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
-
rRenderContext.SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor());
-rRenderContext.Erase(tools::Rectangle(Point(0, nTxtOffset), 
Point(aWinSize.Width(), aWinSize.Height(;
-}
+
+
rRenderContext.SetTextColor(Application::GetSettings().GetStyleSettings().GetButtonTextColor());
 rRenderContext.DrawText(Point((aWinSize.Width() - nTxtWidth) / 2, 
nTxtOffset + (NAME_OFFSET / 2)), rText);
+
+rRenderContext.Pop();
 }
 
 void ValueSet::StyleUpdated()


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

2023-02-14 Thread Caolán McNamara (via logerrit)
 svtools/source/config/miscopt.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit fd92b09db497a7dfd594a5418f87856dc3886bf9
Author: Caolán McNamara 
AuthorDate: Tue Feb 14 13:12:38 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 14 15:51:49 2023 +

tdf#153541 notify listeners when any of the icon sizes change

not just the "normal" toolbar, but also the "notebookbar" and
"sidebar" ones. Existing listeners have assume that this is the
case, so match their expectations to get the notebookbar to
track the config when it changes.

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

diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index 2462a5804659..1ea1e3b7e695 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -47,6 +47,8 @@ constexpr OUStringLiteral PROPERTYNAME_SYMBOLSET = 
u"SymbolSet";
 #define PROPERTYHANDLE_SYMBOLSET0
 constexpr OUStringLiteral PROPERTYNAME_ICONTHEME = u"SymbolStyle";
 #define PROPERTYHANDLE_SYMBOLSTYLE  1
+constexpr OUStringLiteral PROPERTYNAME_SIDEBARICONSIZE = u"SidebarIconSize";
+constexpr OUStringLiteral PROPERTYNAME_NOTEBOOKBARICONSIZE = 
u"NotebookbarIconSize";
 
 static std::mutex & GetInitMutex()
 {
@@ -359,6 +361,11 @@ Sequence< OUString > 
SvtMiscOptions_Impl::GetPropertyNames()
 {
 PROPERTYNAME_SYMBOLSET,
 PROPERTYNAME_ICONTHEME,
+// SidebarIconSize and NotebookbarIconSize so
+// notifications for their changes are also broadcast
+// from SvtMiscOptions
+PROPERTYNAME_SIDEBARICONSIZE,
+PROPERTYNAME_NOTEBOOKBARICONSIZE
 };
 }
 


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

2023-01-31 Thread Caolán McNamara (via logerrit)
 svtools/source/config/languagetoolcfg.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 1af03aaa35dc9758a9702cddf48d9aad02ec7a94
Author: Caolán McNamara 
AuthorDate: Tue Jan 31 11:48:13 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 31 19:57:41 2023 +

language tool warnings in console on start up with language tool not 
configured

warn: 
languagetool:070:070:lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx:372:
 CURL request returned with error: 3
warn: 
languagetool:070:070:lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx:372:
 CURL request returned with error: 3
Change-Id: I67de3351c6f01ed8274b4a282b45ded9f5cea5c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146418
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/svtools/source/config/languagetoolcfg.cxx 
b/svtools/source/config/languagetoolcfg.cxx
index b7bc2a56bd37..bc18e23980db 100644
--- a/svtools/source/config/languagetoolcfg.cxx
+++ b/svtools/source/config/languagetoolcfg.cxx
@@ -62,9 +62,19 @@ void SvxLanguageToolOptions::setUsername(const OUString& 
rVal)
 SetModified();
 }
 
-OUString SvxLanguageToolOptions::getLocaleListURL() const { return 
pImpl->sBaseURL + "/languages"; }
+OUString SvxLanguageToolOptions::getLocaleListURL() const
+{
+if (pImpl->sBaseURL.isEmpty())
+return OUString();
+return pImpl->sBaseURL + "/languages";
+}
 
-OUString SvxLanguageToolOptions::getCheckerURL() const { return 
pImpl->sBaseURL + "/check"; }
+OUString SvxLanguageToolOptions::getCheckerURL() const
+{
+if (pImpl->sBaseURL.isEmpty())
+return OUString();
+return pImpl->sBaseURL + "/check";
+}
 
 const OUString& SvxLanguageToolOptions::getApiKey() const { return 
pImpl->sApiKey; }
 


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

2023-01-24 Thread Andrea Gelmini (via logerrit)
 svtools/source/config/colorcfg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 81ced283de2d0da377225afeb589b793716238bd
Author: Andrea Gelmini 
AuthorDate: Tue Jan 24 21:10:29 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Jan 25 06:08:34 2023 +

Fix typo

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

diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 2d584d9c5d95..452104361729 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -403,7 +403,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
 COL_BLACK, // CALCTEXT
 COL_LIGHTGRAY, // CALCPROTECTEDBACKGROUND
 COL_GRAY7, // DRAWGRID
-COL_WHITE, // BASICIEDITOR,
+COL_WHITE, // BASICEDITOR,
 COL_GREEN, // BASICIDENTIFIER,
 COL_GRAY, // BASICCOMMENT,
 COL_LIGHTRED, // BASICNUMBER,


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

2023-01-24 Thread Andreas Heinisch (via logerrit)
 svtools/source/control/tabbar.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit be86c8f2432623fdb8ed4f22ca08c35121fd8bec
Author: Andreas Heinisch 
AuthorDate: Thu Jan 19 08:56:04 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Jan 24 08:04:02 2023 +

tdf#100584 - Arrange sheets in the tab bar depending on the RTL settings

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

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 7daba1791d3e..b09c748feb5e 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -704,10 +704,15 @@ void TabBar::ImplFormat()
 if (!mbFormat)
 return;
 
-sal_uInt16 nItemIndex = 0;
 tools::Long x = mnOffX;
-for (auto & rItem : mpImpl->maItemList)
+
+const size_t nItemListSize = mpImpl->maItemList.size();
+for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++)
 {
+// tdf#100584 - arrange sheets depending on the RTL settings
+auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - 
nItemIndex - 1]
+ : mpImpl->maItemList[nItemIndex];
+
 // At all non-visible tabs an empty rectangle is set
 if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
 rItem.maRect.SetEmpty();
@@ -735,8 +740,6 @@ void TabBar::ImplFormat()
 rItem.maRect.SetLeft(nNewLeft);
 }
 }
-
-nItemIndex++;
 }
 
 mbFormat = false;


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

2023-01-21 Thread Noel Grandin (via logerrit)
 svtools/source/uno/unoimap.cxx |   23 +--
 1 file changed, 5 insertions(+), 18 deletions(-)

New commits:
commit 3c08e71af3629bc653f9eca8e570a3be9eaabac8
Author: Noel Grandin 
AuthorDate: Fri Jan 20 13:24:35 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Jan 21 18:01:20 2023 +

XUnoTunnel->dynamic_cast in SvUnoImageMapObject/SvUnoImageMap

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

diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 4d64cc8b405e..64d7521fc63b 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -69,15 +68,12 @@ class SvUnoImageMapObject : public OWeakAggObject,
 public XEventsSupplier,
 public XServiceInfo,
 public PropertySetHelper,
-public XTypeProvider,
-public XUnoTunnel
+public XTypeProvider
 {
 public:
 SvUnoImageMapObject( IMapObjectType nType, const SvEventDescription* 
pSupportedMacroItems );
 SvUnoImageMapObject( const IMapObject& rMapObject, const 
SvEventDescription* pSupportedMacroItems );
 
-UNO3_GETIMPLEMENTATION_DECL( SvUnoImageMapObject )
-
 std::unique_ptr createIMapObject() const;
 
 rtl::Reference mxEvents;
@@ -124,8 +120,6 @@ private:
 
 }
 
-UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject );
-
 rtl::Reference SvUnoImageMapObject::createPropertySetInfo( 
IMapObjectType nType )
 {
 switch( nType )
@@ -317,8 +311,6 @@ Any SAL_CALL SvUnoImageMapObject::queryAggregation( const 
Type & rType )
 aAny <<= Reference< XEventsSupplier >(this);
 else if( rType == cppu::UnoType::get())
 aAny <<= Reference< XMultiPropertySet >(this);
-else if( rType == cppu::UnoType::get())
-aAny <<= Reference< XUnoTunnel >(this);
 else
 aAny = OWeakAggObject::queryAggregation( rType );
 
@@ -343,8 +335,7 @@ uno::Sequence< uno::Type > SAL_CALL 
SvUnoImageMapObject::getTypes()
 cppu::UnoType::get(),
 cppu::UnoType::get(),
 cppu::UnoType::get(),
-cppu::UnoType::get(),
-cppu::UnoType::get() };
+cppu::UnoType::get() };
 return aTypes;
 }
 
@@ -499,7 +490,7 @@ Reference< XNameReplace > SAL_CALL 
SvUnoImageMapObject::getEvents()
 
 namespace {
 
-class SvUnoImageMap : public WeakImplHelper< XIndexContainer, XServiceInfo, 
XUnoTunnel >
+class SvUnoImageMap : public WeakImplHelper< XIndexContainer, XServiceInfo >
 {
 public:
 explicit SvUnoImageMap();
@@ -509,8 +500,6 @@ public:
 /// @throws IllegalArgumentException
 static SvUnoImageMapObject* getObject( const Any& aElement );
 
-UNO3_GETIMPLEMENTATION_DECL( SvUnoImageMap )
-
 // XIndexContainer
 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const Any& Element ) 
override;
 virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override;
@@ -539,8 +528,6 @@ private:
 
 }
 
-UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMap );
-
 SvUnoImageMap::SvUnoImageMap()
 {
 }
@@ -563,7 +550,7 @@ SvUnoImageMapObject* SvUnoImageMap::getObject( const Any& 
aElement )
 Reference< XInterface > xObject;
 aElement >>= xObject;
 
-SvUnoImageMapObject* pObject = 
comphelper::getFromUnoTunnel( xObject );
+SvUnoImageMapObject* pObject = dynamic_cast( 
xObject.get() );
 if( nullptr == pObject )
 throw IllegalArgumentException();
 
@@ -709,7 +696,7 @@ Reference< XInterface > SvUnoImageMap_createInstance( const 
ImageMap& rMap, cons
 
 bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, 
ImageMap& rMap )
 {
-SvUnoImageMap* pUnoImageMap = comphelper::getFromUnoTunnel( 
xImageMap );
+SvUnoImageMap* pUnoImageMap = dynamic_cast( 
xImageMap.get() );
 if( nullptr == pUnoImageMap )
 return false;
 


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

2023-01-20 Thread Caolán McNamara (via logerrit)
 svtools/source/control/ctrlbox.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 675a3e3d545c5811c35bbd189ff0a241a83443d0
Author: Caolán McNamara 
AuthorDate: Fri Jan 20 09:43:39 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 20 12:33:13 2023 +

std::abort() during CppunitTest_sw_layoutwriter

seen in fedora distro build. Probably since:

commit 4170b94c443b3bd68b4cc75b8c344ecca3c249b0
Date:   Tue Nov 8 18:27:05 2022 +0100

SwModelTestBase: inherit from UnoApiXmlTest

See original discussion in https://gerrit.libreoffice.org/c/core/+/142465

use an alternative approach to solve this

[_RUN_] testTdf143239::TestBody
Fatal exception: Signal 6
Stack:

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libuno_sal.so.3(+0x48bd8)[0x95428bd8]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libuno_sal.so.3(+0x4fd8c)[0x9542fd8c]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0x955247fc]
/lib64/libc.so.6(+0x8d568)[0x94f2d568]
/lib64/libc.so.6(gsignal+0x20)[0x94ee3e80]
/lib64/libc.so.6(abort+0xf4)[0x94ed0284]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN3psp16PrintFontManager10SubstituteERN3vcl4font17FontSelectPatternERN3rtl8OUStringE+0xbc4)[0x91980de4]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(+0x891ea8)[0x91981ea8]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZNK3vcl4font22PhysicalFontCollection20GetGlyphFallbackFontERNS0_17FontSelectPatternEP19LogicalFontInstanceRN3rtl8OUStringEi+0xd0)[0x9186a7c0]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZNK12OutputDevice10ImplLayoutERKN3rtl8OUStringEiiRK5Pointl13KernArraySpanN4o3tl4spanIKhEE14SalLayoutFlagsPKN3vcl4text15TextLayoutCacheEPK15SalLayoutGlyphs+0x112c)[0x915be0c0]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZNK12OutputDevice12GetTextArrayERKN3rtl8OUStringEP9KernArrayiibPKN3vcl4text15TextLayoutCacheEPK15SalLayoutGlyphs+0x2c4)[0x915bf2b8]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN18ImplFontMetricData20ImplInitTextLineSizeEPK12OutputDevice+0x74)[0x91873da4]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZNK12OutputDevice11ImplNewFontEv+0x1c8)[0x915b7318]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(+0x4c5f70)[0x915b5f70]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZNK12OutputDevice14GetFontCharMapERN5tools5SvRefI11FontCharMapEE+0x34)[0x915b9004]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZNK12OutputDevice9HasGlyphsERKN3vcl4FontESt17basic_string_viewIDsSt11char_traitsIDsEEii+0x90)[0x915b9300]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libsvtlo.so(+0xff560)[0x8cadf560]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libsvtlo.so(_ZN11FontNameBox12CachePreviewEmP5Point+0x288)[0x8cae0168]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libsvtlo.so(+0x100448)[0x8cae0448]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN9Scheduler22CallbackTaskSchedulingEv+0x30c)[0x917b050c]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN14SvpSalInstance12CheckTimeoutEb+0x140)[0x919790a0]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN14SvpSalInstance9ImplYieldEbb+0x98)[0x91979818]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN14SvpSalInstance7DoYieldEbb+0xe0)[0x91979b70]

/builddir/build/BUILD/libreoffice-7.5.0.2/instdir/program/libvcllo.so(_ZN9Scheduler19ProcessEventsToIdleEv+0x40)[0x917bac84]

/builddir/build/BUILD/libreoffice-7.5.0.2/workdir/LinkTarget/CppunitTest/libtest_sw_layoutwriter.so(+0x5520c)[0x8d87520c]
/lib64/libcppunit-1.15.so.1(+0x1e4dc)[0x9549e4dc]

/builddir/build/BUILD/libreoffice-7.5.0.2/workdir/LinkTarget/Library/unoexceptionprotector.so(+0x107ec)[0x94e107ec]

/lib64/libcppunit-1.15.so.1(_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE+0x3c)[0x9549e1cc]

/lib64/libcppunit-1.15.so.1(_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE+0x320)[0x954969f4]

/lib64/libcppunit-1.15.so.1(_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x80)[0x954a06d0]

/lib64/libcppunit-1.15.so.1(_ZN7CppUnit8TestCase3runEPNS_10TestResultE+0x11c)[0x954a993c]

/lib64/libcppunit-1.15.so.1(_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE+0xe0)[0x9549e980]

/lib64/libcppunit-1.15.so.1(_ZN7CppUnit13TestComposite3runEPNS_10TestResultE+0x58)[0x9549e6a8]


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

2023-01-04 Thread Eike Rathke (via logerrit)
 svtools/source/misc/langtab.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit cb4c33ef88a0ef252383e7a12678f28c4432347e
Author: Eike Rathke 
AuthorDate: Wed Jan 4 21:35:08 2023 +0100
Commit: Eike Rathke 
CommitDate: Thu Jan 5 00:29:39 2023 +

Related: tdf#152781 Add also non-on-the-fly IDs to language list

Generating names more than once is unnecessary.
This may happen for defined mappings that have no explicitly
predefined language list entry.

Change-Id: I278e6d77181b661a90d0fb133cb3ca30c2a9b721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145049
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 0341e54949cc..0f5f15257856 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -243,10 +243,8 @@ OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType ) const
 << " with unknown name, so returning generated: "
 << sLangTag);
 
-// And add it to the table if it is an on-the-fly-id, which it usually is,
-// so it is available in all subsequent language boxes.
-if (LanguageTag::isOnTheFlyID( nLang))
-const_cast(this)->AddEntry( sLangTag, nLang);
+// And add it to the table, so it is available in all subsequent language 
boxes.
+const_cast(this)->AddEntry( sLangTag, nLang);
 
 return sLangTag;
 }


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

2023-01-04 Thread Eike Rathke (via logerrit)
 svtools/source/misc/langtab.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8343376c10eef50a022f600e0bd03f1384e9a288
Author: Eike Rathke 
AuthorDate: Wed Jan 4 21:14:03 2023 +0100
Commit: Eike Rathke 
CommitDate: Wed Jan 4 23:13:52 2023 +

Related: tdf#152781 s/lang-tag of/generated/ in SAL_WARN

Only cosmetical to clarify, if possible a complete UI name is
generated, not just the language tag as before.

Change-Id: Id38e397793807762c2698948c325e6eeda989cc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145048
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 18099a828f27..0341e54949cc 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -240,7 +240,7 @@ OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType ) const
 OUString sLangTag( lcl_getDescription( LanguageTag(nLang)));
 SAL_WARN("svtools.misc", "Language: 0x"
 << std::hex << nLang
-<< " with unknown name, so returning lang-tag of: "
+<< " with unknown name, so returning generated: "
 << sLangTag);
 
 // And add it to the table if it is an on-the-fly-id, which it usually is,


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

2022-12-29 Thread Ilhan Yesil (via logerrit)
 svtools/source/uno/wizard/wizardpagecontroller.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit aef2ee893c7b76794bc9db869f08bbbea60606a8
Author: Ilhan Yesil 
AuthorDate: Fri Dec 16 07:30:13 2022 +0100
Commit: Michael Weghorn 
CommitDate: Thu Dec 29 13:46:04 2022 +

tdf#152508 Initiate container request size after call of createPage

As the container's request size of wizard pages can't be changed
directly by the UNO call setPosSize, the UNO caller can set the size
in the callback function createPage, this size will then taken as
request size. This doesn't solve the problem entirely as descriped
in tdf#152508, but the most important is, that the wizard page can
be initialized with an appropriate size at startup.

Change-Id: I1899da9c018681291559eb7c0de25a3e2e8af14e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144287
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: Michael Weghorn 

diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx 
b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 333d7ce27351..850d9b102c7a 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -50,7 +50,16 @@ namespace svt::uno
 try
 {
 // Plug a toplevel SalFrame into the native page which can host 
our awt widgetry
-
m_xWizardPage.set(m_xController->createPage(pParent->CreateChildFrame(), 
i_nPageId), UNO_SET_THROW);
+css::uno::Reference xChildFrame = 
pParent->CreateChildFrame();
+// If size of page is changed by createPage, then the requested 
size of the container
+// should also be set to this size, to avoid annoying resizings.
+com::sun::star::awt::Rectangle r0 = xChildFrame->getPosSize();
+m_xWizardPage.set(m_xController->createPage(xChildFrame, 
i_nPageId), UNO_SET_THROW);
+com::sun::star::awt::Rectangle r1 = xChildFrame->getPosSize();
+if (r0.Width != r1.Width || r0.Height != r1.Height)
+{
+pParent->set_size_request(r1.Width, r1.Height);
+}
 
 Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), 
UNO_SET_THROW);
 xPageWindow->setVisible( true );


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

2022-12-25 Thread Khaled Hosny (via logerrit)
 svtools/source/misc/sampletext.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 18b39c8c9b35528c8fb172339126b613827d09aa
Author: Khaled Hosny 
AuthorDate: Mon Dec 26 00:25:54 2022 +0200
Commit: خالد حسني 
CommitDate: Sun Dec 25 23:15:30 2022 +

tdf#88484: Show sample text for Abyssinica SIL font

The font sets Arabic Presentation Forms-B bit, probably because it
includes U+FEFF (Zero Width Space) which happens to be in that block but
it isn’t an Arabic code point. Filter this bit out if we already decided
it isn’t an Arabic font.

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

diff --git a/svtools/source/misc/sampletext.cxx 
b/svtools/source/misc/sampletext.cxx
index a181fdde238c..abcfde92b7a1 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -1122,6 +1122,12 @@ namespace
 
 aMasked.set(vcl::UnicodeCoverage::GREEK_EXTENDED, false);
 aMasked.set(vcl::UnicodeCoverage::GREEK_AND_COPTIC, false);
+// tdf#88484
+// Some fonts set the Arabic Presentation Forms-B bit because they
+// support U+FEFF (Zero Width Space) which happens to be in that block
+// but it isn’t an Arabic code point. By the time we reach here we
+// decided this isn’t an Arabic font, so it should be safe.
+aMasked.set(vcl::UnicodeCoverage::ARABIC_PRESENTATION_FORMS_B, false);
 if (aMasked.count() == 1)
 return 
otCoverageToScript(static_cast(find_first(aMasked)));
 


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

2022-11-09 Thread Rafael Lima (via logerrit)
 svtools/source/control/ruler.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit aa8a8b36b73304431bacd7ed0f8803de8dfffe3e
Author: Rafael Lima 
AuthorDate: Tue Oct 18 18:43:59 2022 +0200
Commit: Rafael Lima 
CommitDate: Wed Nov 9 16:07:13 2022 +0100

tdf#151519 Make ticks in ruler visible again

As reported by the user, the ticks in the ruler are no longer visible. This 
patch draws them using the shadow color.

Tested with: gen, gtk3 and kf5

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

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 340d29b27cfc..6ddac0ccd7d3 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -417,6 +417,7 @@ void Ruler::ImplInvertLines(vcl::RenderContext& 
rRenderContext)
 
 void Ruler::ImplDrawTicks(vcl::RenderContext& rRenderContext, tools::Long 
nMin, tools::Long nMax, tools::Long nStart, tools::Long nTop, tools::Long 
nBottom)
 {
+const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 double nCenter = nTop + ((nBottom - nTop) / 2);
 
 tools::Long nTickLength3 = (nBottom - nTop) * 0.5;
@@ -523,7 +524,7 @@ void Ruler::ImplDrawTicks(vcl::RenderContext& 
rRenderContext, tools::Long nMin,
 }
 else
 {
-
rRenderContext.SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetShadowColor());
+rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
 }
 
 if (bNoTicks)
@@ -576,6 +577,7 @@ void Ruler::ImplDrawTicks(vcl::RenderContext& 
rRenderContext, tools::Long nMin,
 double aStep = nTick / nTick4;
 double aRest = std::abs(aStep - std::floor(aStep));
 double nAcceptanceDelta = 0.0001;
+rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
 
 if (aRest < nAcceptanceDelta)
 {


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

2022-11-08 Thread Caolán McNamara (via logerrit)
 svtools/source/control/ctrlbox.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c4fc1dda75fe7aefce50d77ad05319cd143e6e25
Author: Caolán McNamara 
AuthorDate: Mon Nov 7 21:04:30 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 8 09:18:40 2022 +0100

Resolves: tdf#150273 use same bg as valueset

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index dbfcf84e679f..414c07a8a58c 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1575,6 +1575,8 @@ void SvtLineListBox::UpdatePreview()
 const auto nPos = (aVirDev->GetOutputSizePixel().Height() - 
aImage.GetSizePixel().Height()) / 2;
 aVirDev->Push(vcl::PushFlags::MAPMODE);
 aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
+const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
+aVirDev->SetBackground(rSettings.GetFieldColor());
 aVirDev->Erase();
 aVirDev->DrawImage(Point(0, nPos), aImage);
 m_xControl->set_image(aVirDev.get());


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

2022-10-11 Thread Miklos Vajna (via logerrit)
 svtools/source/misc/embedhlp.cxx |   35 ++-
 1 file changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 0bd83ba4c40bd7c3ebd3f098421c23bc9ced7b9e
Author: Miklos Vajna 
AuthorDate: Tue Oct 11 16:56:24 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Oct 11 18:49:32 2022 +0200

tdf#151470 svtools: prevent storing broken graphic of embedded objects

Updating the preview of the embedded PDF object in the bugdoc leads to
Acrobat generating a new preview, we throw away the old one, write the
new one to the document, and next time the document is opened, we can't
parse it, so the preview is lost for the user.

The reason for this seems to be that sometimes Acrobat generates a
broken WMF: the first 4 bytes is 0x0002 (DISKMETAFILE from the
MetafileType enum), but the next 4 bytes is 0x6f43, which means that the
header size is 56966 bytes long, but the whole preview is 29291, so this
WMF looks broken.

Fix the problem by adding error handling before we insert the WMF we get
from Acrobat as a graphic stream to the document storage: don't update
the graphic stream if the data is something that can't be handled by
VCL's graphic filters. svt::EmbeddedObjectRef::GetReplacement() has a
similar error handling, which is why the preview only gets broken on
document reload.

No testcase, this only happens on Windows and only in case a problematic
handler for PDF is installed, which is hard to test from 'make check'.

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

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index c3e13a551b44..053a30835d2d 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -680,7 +680,40 @@ std::unique_ptr 
EmbeddedObjectRef::GetGraphicStream( bool bUpdate ) co
 if(xStream.is())
 {
 if (mpImpl->pContainer)
-
mpImpl->pContainer->InsertGraphicStream(xStream,mpImpl->aPersistName,mpImpl->aMediaType);
+{
+bool bInsertGraphicStream = true;
+uno::Reference xSeekable(xStream, 
uno::UNO_QUERY);
+std::optional oPosition;
+if (xSeekable.is())
+{
+oPosition = xSeekable->getPosition();
+}
+if (bUpdate)
+{
+std::unique_ptr pResult = 
utl::UcbStreamHelper::CreateStream(xStream);
+if (pResult)
+{
+GraphicFilter& rGF = 
GraphicFilter::GetGraphicFilter();
+Graphic aGraphic;
+rGF.ImportGraphic(aGraphic, u"", *pResult);
+if (aGraphic.IsNone())
+{
+// The graphic is not something we can 
understand, don't overwrite a
+// potentially working previous graphic.
+SAL_WARN("svtools.misc", 
"EmbeddedObjectRef::GetGraphicStream: failed to parse xStream");
+bInsertGraphicStream = false;
+}
+}
+}
+if (xSeekable.is() && oPosition.has_value())
+{
+xSeekable->seek(*oPosition);
+}
+if (bInsertGraphicStream)
+{
+
mpImpl->pContainer->InsertGraphicStream(xStream,mpImpl->aPersistName,mpImpl->aMediaType);
+}
+}
 
 std::unique_ptr pResult = 
::utl::UcbStreamHelper::CreateStream( xStream );
 if (pResult && bUpdate)


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

2022-10-05 Thread Rafael Lima (via logerrit)
 svtools/source/control/tabbar.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 1045aeecb20aeefd7f6181288853f9a89305c9ba
Author: Rafael Lima 
AuthorDate: Sat Oct 1 00:38:46 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Oct 6 06:45:08 2022 +0200

tdf#148938 Fix position arrows when dragging Calc tabs in dark mode

In Calc, when you drag a tab to move it, the arrows pointing to where the 
tab will be positioned are always in black, even in dark mode.

This patch fixes this issue.

Change-Id: I9079099c5ac1a8fb767eaa105cf8863e54d0ec3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140760
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 700c1c37767b..1e9a9172967f 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2331,7 +2331,8 @@ sal_uInt16 TabBar::ShowDropPos(const Point& rPos)
 }
 
 // draw drop position arrows
-Color aBlackColor(COL_BLACK);
+const StyleSettings& rStyles = 
Application::GetSettings().GetStyleSettings();
+const Color aTextColor = rStyles.GetLabelTextColor();
 tools::Long nX;
 tools::Long nY = (maWinSize.Height() / 2) - 1;
 sal_uInt16 nCurPos = GetPagePos(mnCurPageId);
@@ -2340,8 +2341,8 @@ sal_uInt16 TabBar::ShowDropPos(const Point& rPos)
 
 if (mnDropPos < nItemCount)
 {
-GetOutDev()->SetLineColor(aBlackColor);
-GetOutDev()->SetFillColor(aBlackColor);
+GetOutDev()->SetLineColor(aTextColor);
+GetOutDev()->SetFillColor(aTextColor);
 
 auto& rItem = mpImpl->maItemList[mnDropPos];
 nX = rItem.maRect.Left();
@@ -2364,8 +2365,8 @@ sal_uInt16 TabBar::ShowDropPos(const Point& rPos)
 }
 if (mnDropPos > 0 && mnDropPos < nItemCount + 1)
 {
-GetOutDev()->SetLineColor(aBlackColor);
-GetOutDev()->SetFillColor(aBlackColor);
+GetOutDev()->SetLineColor(aTextColor);
+GetOutDev()->SetFillColor(aTextColor);
 
 auto& rItem = mpImpl->maItemList[mnDropPos - 1];
 nX = rItem.maRect.Right();


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

2022-10-05 Thread Eike Rathke (via logerrit)
 svtools/source/misc/langtab.cxx |   54 ++--
 1 file changed, 47 insertions(+), 7 deletions(-)

New commits:
commit a10d712f7020c00a49085d55b8905caa66729d1c
Author: Eike Rathke 
AuthorDate: Wed Oct 5 01:39:22 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Oct 5 13:23:23 2022 +0200

Use SvtLanguageTableImpl::AddEntry() to determine on-the-fly ScriptType

With a LanguageTag::ScriptType a language tag appears in the
corresponding Western/Asian/Complex language list.

Change-Id: Ifa7fe784ebee33990b552e8df0fdc98667f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140974
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index c3f1da4705d3..18099a828f27 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -31,6 +32,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -50,6 +53,11 @@ class SvtLanguageTableImpl
 {
 private:
 std::vector> m_aStrings;
+voidAddItem(const OUString& rLanguage, const LanguageType 
eType)
+{
+m_aStrings.emplace_back(rLanguage, eType);
+}
+
 public:
 
 SvtLanguageTableImpl();
@@ -59,10 +67,6 @@ public:
 LanguageTypeGetType( std::u16string_view rStr ) const;
 sal_uInt32  GetEntryCount() const;
 LanguageTypeGetTypeAtIndex( sal_uInt32 nIndex ) const;
-voidAddItem(const OUString& rLanguage, const LanguageType 
eType)
-{
-m_aStrings.emplace_back(rLanguage, eType);
-}
 LanguageTypeGetValue(sal_uInt32 nIndex) const
 {
 return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].second : 
LANGUAGE_DONTKNOW;
@@ -77,6 +81,7 @@ public:
 }
 return RESARRAY_INDEX_NOTFOUND;
 }
+voidAddEntry( const OUString& rString, const LanguageType 
eType);
 };
 
 struct theLanguageTable : public rtl::Static< SvtLanguageTableImpl, 
theLanguageTable > {};
@@ -204,7 +209,7 @@ SvtLanguageTableImpl::SvtLanguageTableImpl()
 aLang.setScriptType(LanguageTag::ScriptType(nType));
 sal_uInt32 nPos = FindIndex(nLangType);
 if (nPos == RESARRAY_INDEX_NOTFOUND)
-AddItem((aName.isEmpty() ? lcl_getDescription(aLang) : aName), 
nLangType);
+AddEntry( (aName.isEmpty() ? lcl_getDescription(aLang) : 
aName), nLangType);
 }
 }
 }
@@ -241,7 +246,7 @@ OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType ) const
 // And add it to the table if it is an on-the-fly-id, which it usually is,
 // so it is available in all subsequent language boxes.
 if (LanguageTag::isOnTheFlyID( nLang))
-const_cast(this)->AddItem( sLangTag, nLang);
+const_cast(this)->AddEntry( sLangTag, nLang);
 
 return sLangTag;
 }
@@ -296,10 +301,45 @@ LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( 
sal_uInt32 nIndex )
 return theLanguageTable::get().GetTypeAtIndex( nIndex);
 }
 
+void SvtLanguageTableImpl::AddEntry( const OUString& rString, const 
LanguageType eType )
+{
+if (LanguageTag::isOnTheFlyID(eType)
+&& LanguageTag::getOnTheFlyScriptType(eType) == 
LanguageTag::ScriptType::UNKNOWN)
+{
+// Classify the script type to distribute the entry into the proper
+// language list later.
+LanguageTag aLanguageTag(eType);
+const sal_Int16 nScriptClass = unicode::getScriptClassFromLanguageTag( 
aLanguageTag);
+LanguageTag::ScriptType eScriptType;
+switch (nScriptClass)
+{
+default:
+eScriptType = LanguageTag::ScriptType::WESTERN;
+assert(!"unexpected ScriptType");
+break;
+case css::i18n::ScriptType::WEAK:
+case css::i18n::ScriptType::LATIN:
+eScriptType = LanguageTag::ScriptType::WESTERN;
+break;
+case css::i18n::ScriptType::ASIAN:
+eScriptType = LanguageTag::ScriptType::CJK;
+break;
+case css::i18n::ScriptType::COMPLEX:
+/* TODO: determine if it would be LanguageTag::ScriptType::RTL
+ * instead; could that be done by
+ * getScriptClassFromLanguageTag() as well by asking Unicode
+ * properties? */
+eScriptType = LanguageTag::ScriptType::CTL;
+break;
+}
+aLanguageTag.setScriptType( eScriptType);
+}
+AddItem( rString, eType);
+}
 
 void SvtLanguageTable::AddLanguageTag( const LanguageTag& rLanguageTag )
 {
-theLanguageTable::get().AddItem( lcl_getDescription(rLanguageTag), 
rLanguageTag.getLanguageType());
+theLanguageTable::get().AddEntry( lcl_getDescription(rLanguageTag), 
rLanguageTag.getLanguageType());
 }
 
 /* vim:set shiftwidth=4 

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

2022-09-03 Thread Julien Nabet (via logerrit)
 svtools/source/dialogs/insdlg.cxx |   27 ++-
 1 file changed, 2 insertions(+), 25 deletions(-)

New commits:
commit 871f5e60047002238df907f4b9406bf205cf16fa
Author: Julien Nabet 
AuthorDate: Sat Sep 3 09:06:41 2022 +0200
Commit: Caolán McNamara 
CommitDate: Sat Sep 3 21:52:16 2022 +0200

Simplify by using replaceAll instead of replaceAt in a loop

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

diff --git a/svtools/source/dialogs/insdlg.cxx 
b/svtools/source/dialogs/insdlg.cxx
index adaa1b905275..7c8703993e3b 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -127,12 +127,6 @@ void SvObjectServerList::FillInsertObjects()
 {
 const uno::Sequence< OUString > seqNames= 
xNameAccess->getElementNames();
 
-OUString aStringProductName( "%PRODUCTNAME" );
-sal_Int32 nStringProductNameLength = 
aStringProductName.getLength();
-
-OUString aStringProductVersion( "%PRODUCTVERSION" );
-sal_Int32 nStringProductVersionLength = 
aStringProductVersion.getLength();
-
 for( const auto& rName : seqNames )
 {
 uno::Reference< container::XNameAccess > xEntry ;
@@ -146,25 +140,8 @@ void SvObjectServerList::FillInsertObjects()
 
 if ( !aUIName.isEmpty() )
 {
-// replace %PRODUCTNAME
-sal_Int32 nIndex = aUIName.indexOf( aStringProductName 
);
-while( nIndex != -1 )
-{
-aUIName = aUIName.replaceAt(
-nIndex, nStringProductNameLength,
-utl::ConfigManager::getProductName() );
-nIndex = aUIName.indexOf( aStringProductName );
-}
-
-// replace %PRODUCTVERSION
-nIndex = aUIName.indexOf( aStringProductVersion );
-while( nIndex != -1 )
-{
-aUIName = aUIName.replaceAt(
-nIndex, nStringProductVersionLength,
-utl::ConfigManager::getProductVersion() );
-nIndex = aUIName.indexOf( aStringProductVersion );
-}
+aUIName = aUIName.replaceAll("%PRODUCTNAME", 
utl::ConfigManager::getProductName());
+aUIName = aUIName.replaceAll("%PRODUCTVERSION", 
utl::ConfigManager::getProductVersion());
 }
 
 SvGlobalName aClassName;


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

2022-08-12 Thread Luboš Luňák (via logerrit)
 svtools/source/svrtf/parrtf.cxx |   35 +--
 1 file changed, 21 insertions(+), 14 deletions(-)

New commits:
commit c62a987ebce52f7e30afb1f6bce4c7bd3ac45644
Author: Luboš Luňák 
AuthorDate: Fri Aug 12 13:01:24 2022 +0200
Commit: Luboš Luňák 
CommitDate: Fri Aug 12 15:34:39 2022 +0200

revert direct append to aToken in SvRTFParser::ScanText() (tdf#150151)

This reverts most of commit 09558e2f45e27d572fd261562c884c2d2cc896a7,
the problem is that GetNextToken_() resets aToken, overwriting the value
created by this function.

Change-Id: I1daca07a6e01cfecfeff9fbf7c311b0d392d84d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138190
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 8f55ae448d44..42fcc211b264 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -302,9 +302,9 @@ sal_Unicode SvRTFParser::GetHexValue()
 void SvRTFParser::ScanText()
 {
 const sal_Unicode cBreak = 0;
-const sal_uInt32 nStartLength = aToken.getLength();
+OUStringBuffer aStrBuffer;
 bool bContinue = true;
-while( bContinue && IsParserWorking() && aToken.getLength() - nStartLength 
< MAX_STRING_LEN)
+while( bContinue && IsParserWorking() && aStrBuffer.getLength() < 
MAX_STRING_LEN)
 {
 bool bNextCh = true;
 switch( nNextCh )
@@ -343,10 +343,10 @@ void SvRTFParser::ScanText()
 {
 if (!aByteString.isEmpty())
 {
-aToken.append( 
OStringToOUString(aByteString, GetSrcEncoding()) );
+aStrBuffer.append( 
OStringToOUString(aByteString, GetSrcEncoding()) );
 aByteString.setLength(0);
 }
-
aToken.append(static_cast(next));
+
aStrBuffer.append(static_cast(next));
 
 continue;
 }
@@ -387,7 +387,7 @@ void SvRTFParser::ScanText()
 
 if (!aByteString.isEmpty())
 {
-aToken.append( OStringToOUString(aByteString, 
GetSrcEncoding()) );
+aStrBuffer.append( OStringToOUString(aByteString, 
GetSrcEncoding()) );
 aByteString.setLength(0);
 }
 }
@@ -396,16 +396,16 @@ void SvRTFParser::ScanText()
 case '}':
 case '{':
 case '+':   // I found in a RTF file
-aToken.append(sal_Unicode(nNextCh));
+aStrBuffer.append(sal_Unicode(nNextCh));
 break;
 case '~':   // nonbreaking space
-aToken.append(u'\x00A0');
+aStrBuffer.append(u'\x00A0');
 break;
 case '-':   // optional hyphen
-aToken.append(u'\x00AD');
+aStrBuffer.append(u'\x00AD');
 break;
 case '_':   // nonbreaking hyphen
-aToken.append(u'\x2011');
+aStrBuffer.append(u'\x2011');
 break;
 
 case 'u':
@@ -418,12 +418,12 @@ void SvRTFParser::ScanText()
 {
 bRTF_InTextRead = true;
 
-OUString sSave( aToken );
+OUString sSave( aToken ); // GetNextToken_() 
overwrites this
 nNextCh = '\\';
 int nToken = GetNextToken_();
 DBG_ASSERT( RTF_U == nToken, "still not a UNI-Code 
character" );
 // don't convert symbol chars
-aToken.append(static_cast< sal_Unicode 
>(nTokenValue));
+aStrBuffer.append(static_cast< sal_Unicode 
>(nTokenValue));
 
 // overread the next n "RTF" characters. This
 // can be also \{, \}, \'88
@@ -494,20 +494,24 @@ void SvRTFParser::ScanText()
 break;
 
 default:
-if( nNextCh == cBreak || aToken.getLength() - nStartLength >= 
MAX_STRING_LEN)
+if( nNextCh == cBreak || aStrBuffer.getLength() >= MAX_STRING_LEN)
 bContinue = false;
 else
 {
 do {
 // all other characters end up in the text
-aToken.appendUtf32(nNextCh);
+aStrBuffer.appendUtf32(nNextCh);
 
 if (sal_Unicode(EOF) == (nNextCh = GetNextChar()))
+{
+

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

2022-08-05 Thread Caolán McNamara (via logerrit)
 svtools/source/control/scrolladaptor.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9788bdc8c821becf54fda989d66fcba72f218ee5
Author: Caolán McNamara 
AuthorDate: Fri Aug 5 09:55:26 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 5 13:06:00 2022 +0200

start with size at optimal size

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

diff --git a/svtools/source/control/scrolladaptor.cxx 
b/svtools/source/control/scrolladaptor.cxx
index 492adf403607..d6805f2b86b3 100644
--- a/svtools/source/control/scrolladaptor.cxx
+++ b/svtools/source/control/scrolladaptor.cxx
@@ -25,6 +25,7 @@ ScrollAdaptor::ScrollAdaptor(vcl::Window* pWin, bool bHoriz)
 , m_bHori(bHoriz)
 {
 m_xScrollBar->show();
+SetSizePixel(GetOptimalSize());
 }
 
 void ScrollAdaptor::dispose()


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

2022-07-18 Thread Caolán McNamara (via logerrit)
 svtools/source/control/accessibleruler.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit e86291cc922fc467dd9ee74ea7afdb3e51f016a8
Author: Caolán McNamara 
AuthorDate: Mon Jul 18 09:05:53 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jul 18 15:49:34 2022 +0200

cid#1507356 Logically dead code

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

diff --git a/svtools/source/control/accessibleruler.cxx 
b/svtools/source/control/accessibleruler.cxx
index 4fec393c0012..2ad8d14a4213 100644
--- a/svtools/source/control/accessibleruler.cxx
+++ b/svtools/source/control/accessibleruler.cxx
@@ -212,12 +212,6 @@ sal_Int64 SAL_CALL 
SvtRulerAccessible::getAccessibleStateSet()
 nStateSet |= AccessibleStateType::HORIZONTAL;
 else
 nStateSet |= AccessibleStateType::VERTICAL;
-
-if(nStateSet & AccessibleStateType::FOCUSABLE)
-{
-nStateSet &= ~AccessibleStateType::FOCUSABLE;
-}
-
 }
 
 return nStateSet;


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

2022-06-24 Thread Xisco Fauli (via logerrit)
 svtools/source/control/ctrlbox.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 72412c5773152a8023530b9807a42d7588f76f2b
Author: Xisco Fauli 
AuthorDate: Tue Jun 21 16:58:24 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 24 18:01:06 2022 +0200

svtools: avoid divide by zero in calcCustomItemSize

See 
https://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::calcCustomItemSize

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index ecce7fa8af21..4ce41da23721 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -343,7 +343,8 @@ namespace
 gUserItemSz.setHeight(gUserItemSz.Height() / 10);
 
 size_t nMaxDeviceHeight = SAL_MAX_INT16 / 16; // see 
limitXCreatePixmap and be generous wrt up to x16 hidpi
-gPreviewsPerDevice = nMaxDeviceHeight / gUserItemSz.Height();
+assert(gUserItemSz.Height() != 0);
+gPreviewsPerDevice = gUserItemSz.Height() == 0 ? 16 : nMaxDeviceHeight 
/ gUserItemSz.Height();
 }
 }
 


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

2022-06-21 Thread Jan-Marek Glogowski (via logerrit)
 svtools/source/control/ctrlbox.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d48dd6057ecc50dbb31d24adce76aaf27d16db16
Author: Jan-Marek Glogowski 
AuthorDate: Mon Jun 20 14:39:55 2022 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Tue Jun 21 17:00:40 2022 +0200

Correctly free font previews on settings change

Change-Id: I9fdce7c9fb8a18571d3d6a317b28a344f18efa82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136227
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 411a2dd4961d..ecce7fa8af21 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -355,6 +355,8 @@ IMPL_LINK(FontNameBox, SettingsChangedHdl, VclSimpleEvent&, 
rEvent, void)
 DataChangedEvent* pData = 
static_cast(static_cast(rEvent).GetData());
 if (pData->GetType() == DataChangedEventType::SETTINGS)
 {
+for (auto  : gFontPreviewVirDevs)
+rDev.disposeAndClear();
 gFontPreviewVirDevs.clear();
 gRenderedFontNames.clear();
 calcCustomItemSize(*m_xComboBox);


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

2022-05-03 Thread Stephan Bergmann (via logerrit)
 svtools/source/brwbox/brwbox1.cxx |   42 +-
 svtools/source/brwbox/editbrowsebox.cxx   |4 +-
 svtools/source/brwbox/editbrowsebox2.cxx  |2 -
 svtools/source/control/inettbc.cxx|2 -
 svtools/source/misc/bindablecontrolhelper.cxx |8 ++--
 svtools/source/svhtml/parhtml.cxx |2 -
 svtools/source/table/cellvalueconversion.cxx  |2 -
 svtools/source/table/tablecontrol.cxx |2 -
 svtools/source/table/tablecontrol_impl.cxx|5 +--
 svtools/source/uno/genericunodialog.cxx   |2 -
 svtools/source/uno/svtxgridcontrol.cxx|9 ++---
 svtools/source/uno/unoimap.cxx|2 -
 12 files changed, 40 insertions(+), 42 deletions(-)

New commits:
commit a3f4f372aa4f6a693ae8abe829a539b9d3977de1
Author: Stephan Bergmann 
AuthorDate: Tue May 3 20:06:37 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 3 23:18:02 2022 +0200

Just use Any ctor instead of makeAny in svtools

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

diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index 18a5f772613f..1d4a13f2c725 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -494,7 +494,7 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, 
sal_uInt16 nPos )
 
 commitTableEvent(
 TABLE_MODEL_CHANGED,
-makeAny( AccessibleTableModelChange(
+Any( AccessibleTableModelChange(
 COLUMNS_REMOVED,
 -1,
 -1,
@@ -507,7 +507,7 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, 
sal_uInt16 nPos )
 
 commitTableEvent(
 TABLE_MODEL_CHANGED,
-makeAny( AccessibleTableModelChange(
+Any( AccessibleTableModelChange(
 COLUMNS_INSERTED,
 -1,
 -1,
@@ -557,8 +557,8 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const 
OUString& rTitle )
 if ( isAccessibleAlive() )
 {
 commitTableEvent(   TABLE_COLUMN_DESCRIPTION_CHANGED,
-makeAny( rTitle ),
-makeAny( sOld )
+Any( rTitle ),
+Any( sOld )
 );
 }
 }
@@ -740,7 +740,7 @@ void BrowseBox::RemoveColumn( sal_uInt16 nItemId )
 
 commitTableEvent(
 TABLE_MODEL_CHANGED,
-makeAny( AccessibleTableModelChange(COLUMNS_REMOVED,
+Any( AccessibleTableModelChange(COLUMNS_REMOVED,
 -1,
 -1,
 nPos,
@@ -753,7 +753,7 @@ void BrowseBox::RemoveColumn( sal_uInt16 nItemId )
 commitHeaderBarEvent(
 CHILD,
 Any(),
-makeAny( CreateAccessibleColumnHeader( nPos ) ),
+Any( CreateAccessibleColumnHeader( nPos ) ),
 true
 );
 }
@@ -801,20 +801,20 @@ void BrowseBox::RemoveColumns()
 commitBrowseBoxEvent(
 CHILD,
 Any(),
-
makeAny(m_pImpl->getAccessibleHeaderBar(AccessibleBrowseBoxObjType::ColumnHeaderBar))
+
Any(m_pImpl->getAccessibleHeaderBar(AccessibleBrowseBoxObjType::ColumnHeaderBar))
 );
 
 // and now append it again
 commitBrowseBoxEvent(
 CHILD,
-
makeAny(m_pImpl->getAccessibleHeaderBar(AccessibleBrowseBoxObjType::ColumnHeaderBar)),
+
Any(m_pImpl->getAccessibleHeaderBar(AccessibleBrowseBoxObjType::ColumnHeaderBar)),
 Any()
 );
 
 // notify a table model change
 commitTableEvent(
 TABLE_MODEL_CHANGED,
-makeAny ( AccessibleTableModelChange( COLUMNS_REMOVED,
+Any ( AccessibleTableModelChange( COLUMNS_REMOVED,
 -1,
 -1,
 0,
@@ -1121,20 +1121,20 @@ void BrowseBox::Clear()
 commitBrowseBoxEvent(
 CHILD,
 Any(),
-makeAny( m_pImpl->getAccessibleHeaderBar( 
AccessibleBrowseBoxObjType::RowHeaderBar ) )
+Any( m_pImpl->getAccessibleHeaderBar( 
AccessibleBrowseBoxObjType::RowHeaderBar ) )
 );
 
 // and now append it again
 commitBrowseBoxEvent(
 CHILD,
-makeAny( m_pImpl->getAccessibleHeaderBar( 
AccessibleBrowseBoxObjType::RowHeaderBar ) ),
+Any( m_pImpl->getAccessibleHeaderBar( 
AccessibleBrowseBoxObjType::RowHeaderBar ) ),
 Any()
 );
 
 // notify a table model change
 commitTableEvent(
 TABLE_MODEL_CHANGED,
-makeAny( AccessibleTableModelChange(ROWS_REMOVED,
+Any( AccessibleTableModelChange(ROWS_REMOVED,
 0,
 nOldRowCount,
 -1,
@@ -1220,7 +1220,7 @@ void BrowseBox::RowInserted( sal_Int32 nRow, sal_Int32 
nNumRows, bool bDoPaint,
 {
 commitTableEvent(
 TABLE_MODEL_CHANGED,
-  

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

2022-04-25 Thread Caolán McNamara (via logerrit)
 svtools/source/control/ctrlbox.cxx |   28 
 1 file changed, 12 insertions(+), 16 deletions(-)

New commits:
commit cf1a41c45abd28fb8ef5613338fcb9807d244f9d
Author: Caolán McNamara 
AuthorDate: Mon Apr 25 15:55:31 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 25 18:09:24 2022 +0200

Resolves: tdf#141441 get and set selected entry when "unfrozen"

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index d679b7c46160..411a2dd4961d 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -844,9 +844,10 @@ FontStyleBox::FontStyleBox(std::unique_ptr 
p)
 
 void FontStyleBox::Fill( std::u16string_view rName, const FontList* pList )
 {
-m_xComboBox->freeze();
 OUString aOldText = m_xComboBox->get_active_text();
 int nPos = m_xComboBox->get_active();
+
+m_xComboBox->freeze();
 m_xComboBox->clear();
 
 // does a font with this name already exist?
@@ -949,19 +950,6 @@ void FontStyleBox::Fill( std::u16string_view rName, const 
FontList* pList )
 if ( bNormal || bItalic || bBold )
 m_xComboBox->append_text(pList->GetBoldItalicStr());
 }
-if (!aOldText.isEmpty())
-{
-int nFound = m_xComboBox->find_text(aOldText);
-if (nFound != -1)
-m_xComboBox->set_active(nFound);
-else
-{
-if (nPos >= m_xComboBox->get_count())
-m_xComboBox->set_active(0);
-else
-m_xComboBox->set_active(nPos);
-}
-}
 }
 else
 {
@@ -970,7 +958,16 @@ void FontStyleBox::Fill( std::u16string_view rName, const 
FontList* pList )
 m_xComboBox->append_text(pList->GetItalicStr());
 m_xComboBox->append_text(pList->GetBoldStr());
 m_xComboBox->append_text(pList->GetBoldItalicStr());
-if (!aOldText.isEmpty())
+}
+
+m_xComboBox->thaw();
+
+if (!aOldText.isEmpty())
+{
+int nFound = m_xComboBox->find_text(aOldText);
+if (nFound != -1)
+m_xComboBox->set_active(nFound);
+else
 {
 if (nPos >= m_xComboBox->get_count())
 m_xComboBox->set_active(0);
@@ -978,7 +975,6 @@ void FontStyleBox::Fill( std::u16string_view rName, const 
FontList* pList )
 m_xComboBox->set_active(nPos);
 }
 }
-m_xComboBox->thaw();
 }
 
 FontSizeBox::FontSizeBox(std::unique_ptr p)


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

2022-03-02 Thread Stephan Bergmann (via logerrit)
 svtools/source/svhtml/parhtml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a9e6b8a36b9ecf4f9471a9915cdfab3c99c8bcff
Author: Stephan Bergmann 
AuthorDate: Wed Mar 2 17:32:24 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Mar 2 20:00:00 2022 +0100

memcpy-param-overlap

...seen during CppunitTest_sw_filters_test, regression introduced by
b871d057c45fdd231aa5e1d2b94e7d0a039f4292 "use OUStringBuffer for a string 
that's
modified often (tdf#145862)" turning SvParser::aToken from OUString to
OUStringBuffer:

> ==768636==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges 
[0x6250003ed112,0x6250003ed12e) and [0x6250003ed108, 0x6250003ed124) overlap
>  #0 in __asan_memcpy at 
~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3
>  #1 in rtl::addDataHelper(char16_t*, char16_t const*, unsigned long) at 
include/rtl/stringconcat.hxx:89:9
>  #2 in rtl::ToStringHelper::addData(char16_t*, 
rtl::OUStringBuffer const&) at include/rtl/ustrbuf.hxx:1750:14
>  #3 in rtl::OUStringConcat::addData(char16_t*) const at 
include/rtl/stringconcat.hxx:252:88
>  #4 in rtl::OUStringBuffer& rtl::OUStringBuffer::operator=(rtl::OUStringConcat&&) 
at include/rtl/ustrbuf.hxx:369:17
>  #5 in HTMLParser::FilterXMP(HtmlTokenId) at 
svtools/source/svhtml/parhtml.cxx:1795:24
[...]

Change-Id: Ifc0a36de6503a06799ee4cd50ce57a6110c7d5c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130889
Reviewed-by: Luboš Luňák 
Tested-by: Jenkins

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index f8abfa7c694e..b33734208edc 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1792,7 +1792,7 @@ HtmlTokenId HTMLParser::FilterXMP( HtmlTokenId nToken )
 {
 UnescapeToken();
 sSaveToken += " ";
-aToken = sSaveToken + aToken;
+aToken.insert(0, sSaveToken);
 }
 else
 aToken = sSaveToken;


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

2022-03-01 Thread Luboš Luňák (via logerrit)
 svtools/source/svrtf/parrtf.cxx |   38 ++
 1 file changed, 14 insertions(+), 24 deletions(-)

New commits:
commit 09558e2f45e27d572fd261562c884c2d2cc896a7
Author: Luboš Luňák 
AuthorDate: Tue Mar 1 13:57:26 2022 +0100
Commit: Luboš Luňák 
CommitDate: Tue Mar 1 21:32:34 2022 +0100

avoid a temporary buffer, append to the resulting one (tdf#145862)

It doesn't seem to make a visible performance difference though.

Change-Id: Iec56f4f484dbebcc216308d17422151424d0697c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130790
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 719401d342fe..c6dcef7a0b69 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -32,7 +32,6 @@
 #include 
 
 const int MAX_STRING_LEN = 1024;
-const int MAX_TOKEN_LEN = 128;
 
 #define RTF_ISDIGIT( c ) rtl::isAsciiDigit(c)
 #define RTF_ISALPHA( c ) rtl::isAsciiAlpha(c)
@@ -101,12 +100,10 @@ int SvRTFParser::GetNextToken_()
 {
 aToken = "\\";
 {
-OUStringBuffer aStrBuffer( MAX_TOKEN_LEN );
 do {
-aStrBuffer.appendUtf32(nNextCh);
+aToken.appendUtf32(nNextCh);
 nNextCh = GetNextChar();
 } while( RTF_ISALPHA( nNextCh ) );
-aToken.append( aStrBuffer );
 }
 
 // minus before numeric parameters
@@ -305,9 +302,9 @@ sal_Unicode SvRTFParser::GetHexValue()
 void SvRTFParser::ScanText()
 {
 const sal_Unicode cBreak = 0;
-OUStringBuffer aStrBuffer;
+const sal_uInt32 nStartLength = aToken.getLength();
 bool bContinue = true;
-while( bContinue && IsParserWorking() && aStrBuffer.getLength() < 
MAX_STRING_LEN)
+while( bContinue && IsParserWorking() && aToken.getLength() - nStartLength 
< MAX_STRING_LEN)
 {
 bool bNextCh = true;
 switch( nNextCh )
@@ -345,8 +342,8 @@ void SvRTFParser::ScanText()
 if (next>0xFF) // fix for #i43933# and #i35653#
 {
 if (!aByteString.isEmpty())
-aStrBuffer.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
-
aStrBuffer.append(static_cast(next));
+aToken.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
+
aToken.append(static_cast(next));
 
 continue;
 }
@@ -386,23 +383,23 @@ void SvRTFParser::ScanText()
 bNextCh = false;
 
 if (!aByteString.isEmpty())
-aStrBuffer.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
+aToken.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
 }
 break;
 case '\\':
 case '}':
 case '{':
 case '+':   // I found in a RTF file
-aStrBuffer.append(sal_Unicode(nNextCh));
+aToken.append(sal_Unicode(nNextCh));
 break;
 case '~':   // nonbreaking space
-aStrBuffer.append(u'\x00A0');
+aToken.append(u'\x00A0');
 break;
 case '-':   // optional hyphen
-aStrBuffer.append(u'\x00AD');
+aToken.append(u'\x00AD');
 break;
 case '_':   // nonbreaking hyphen
-aStrBuffer.append(u'\x2011');
+aToken.append(u'\x2011');
 break;
 
 case 'u':
@@ -420,7 +417,7 @@ void SvRTFParser::ScanText()
 int nToken = GetNextToken_();
 DBG_ASSERT( RTF_U == nToken, "still not a UNI-Code 
character" );
 // don't convert symbol chars
-aStrBuffer.append(static_cast< sal_Unicode 
>(nTokenValue));
+aToken.append(static_cast< sal_Unicode 
>(nTokenValue));
 
 // overread the next n "RTF" characters. This
 // can be also \{, \}, \'88
@@ -491,24 +488,20 @@ void SvRTFParser::ScanText()
 break;
 
 default:
-if( nNextCh == cBreak || aStrBuffer.getLength() >= MAX_STRING_LEN)
+if( nNextCh == cBreak || 

[Libreoffice-commits] core.git: svtools/source sw/CppunitTest_sw_core_view.mk sw/Module_sw.mk sw/qa

2022-02-17 Thread Miklos Vajna (via logerrit)
 svtools/source/misc/embedhlp.cxx|   11 ++-
 sw/CppunitTest_sw_core_view.mk  |   70 
 sw/Module_sw.mk |1 
 sw/qa/core/view/data/update-ole-object-previews.odt |binary
 sw/qa/core/view/view.cxx|   70 
 5 files changed, 151 insertions(+), 1 deletion(-)

New commits:
commit 24231f2a336c50eac5e6a1621c57e60ebe1e1cf4
Author: Miklos Vajna 
AuthorDate: Thu Feb 17 18:00:24 2022 +0100
Commit: Miklos Vajna 
CommitDate: Thu Feb 17 19:07:32 2022 +0100

svtools: fix lost replacement non-rendered graphic when updating it fails

This is similar to commit 8780fa41dcd164af244742461f4e57a4bcf4c7a4
(svtools: fix lost replacement grpahic when updating it via OLE fails,
2018-10-30), but that case was when we already had an old
mpImpl->pGraphic, the updated failed and then we already lost the old
one but didn't have a new one.

Here what happened is that in case tools -> update -> update-all was
used for an OLE object which had bad native data but a good preview,
then the result was bad preview, depending on if you first scrolled to
the OLE object to trigger rendering (good) or not (bad).

The reason for this is that scrolling to the object calls GetGraphic(),
which sets mpImpl->pGraphic using GetReplacement(bUpdate=false), which
works, but svt::EmbeddedObjectRef::UpdateReplacement() calls
GetReplacement(bUpdate=true). That explains why the update breaks the
preview, but not when scrolling to it first.

Fix the problem by improving svt::EmbeddedObjectRef::GetReplacement():
if getting an updated graphic fails, try to get a non-updated graphic.

The result is that GetGraphic() after an UpdateReplacement() not only
always return a non-nullptr Graphic, but also it's no longer of type
None.

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

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 4f4a5ce3e364..6e56dc3137e8 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -471,6 +471,15 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
 }
 
 std::unique_ptr pGraphicStream(GetGraphicStream( bUpdate ));
+if (!pGraphicStream && aOldGraphic.IsNone())
+{
+// We have no old graphic, tried to get an updated one, but that 
failed. Try to get an old
+// graphic instead of having no graphic at all.
+pGraphicStream = GetGraphicStream(false);
+SAL_WARN("svtools.misc",
+ "EmbeddedObjectRef::GetReplacement: failed to get updated 
graphic stream");
+}
+
 if ( pGraphicStream )
 {
 GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
@@ -487,7 +496,7 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
 // failed. Go back to the old graphic instead of having no graphic at
 // all.
 mpImpl->pGraphic.reset(new Graphic(aOldGraphic));
-SAL_WARN("svtools.misc", "EmbeddedObjectRef::GetReplacement: update 
failed");
+SAL_WARN("svtools.misc", "EmbeddedObjectRef::GetReplacement: failed to 
update graphic");
 }
 }
 
diff --git a/sw/CppunitTest_sw_core_view.mk b/sw/CppunitTest_sw_core_view.mk
new file mode 100644
index ..c1846e3c91ee
--- /dev/null
+++ b/sw/CppunitTest_sw_core_view.mk
@@ -0,0 +1,70 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_core_view))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_view))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_core_view, \
+sw/qa/core/view/view \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_core_view, \
+cppu \
+cppuhelper \
+sal \
+svl \
+svt \
+sw \
+swqahelper \
+test \
+unotest \
+utl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_core_view,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_core_view,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
+-I$(SRCDIR)/sw/qa/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_core_view,\
+udkapi \
+offapi \
+oovbaapi \
+))
+
+$(eval $(call 

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

2022-02-07 Thread Julien Nabet (via logerrit)
 svtools/source/control/ctrltool.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ad9aa572594f04d2c498d087fb81b0fb215b8e7d
Author: Julien Nabet 
AuthorDate: Sat Feb 5 19:14:33 2022 +0100
Commit: Julien Nabet 
CommitDate: Mon Feb 7 18:05:23 2022 +0100

tdf#113191: Add 21 and 42 in size list for CJK for typographic scale 
convention

Change-Id: I2be3160dbab780254b6f02db8dec69389ec500d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129530
Tested-by: Julien Nabet 
Reviewed-by: Heiko Tietze 
Reviewed-by: Julien Nabet 

diff --git a/svtools/source/control/ctrltool.cxx 
b/svtools/source/control/ctrltool.cxx
index 3d908b342ab8..e031064bf1ba 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -54,6 +54,7 @@ const int FontList::aStdSizeAry[] =
 160,
 180,
 200,
+210,
 220,
 240,
 260,
@@ -61,6 +62,7 @@ const int FontList::aStdSizeAry[] =
 320,
 360,
 400,
+420,
 440,
 480,
 540,


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

2022-01-31 Thread Justin Luth (via logerrit)
 svtools/source/control/ruler.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 2174b56ffb5817e42c8b4f6891214fcb67c55b30
Author: Justin Luth 
AuthorDate: Fri Jan 21 15:43:47 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon Jan 31 12:27:48 2022 +0100

tdf#83523 ruler: Invalidate full ruler rect on app bg change

Instead of waiting for the application to restart,
hack out an immediate invalidation of the ruler.

Perhaps there is a better place to do this
because the ruler background apparently IS
changing, but it seems to require a hack
to invalidate everything.

Change-Id: I4a27cbaf484e96c19c71c04017c649e95bf80d96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128733
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index d3d5af0e00de..07e030aac109 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -994,6 +994,12 @@ void Ruler::ApplySettings(vcl::RenderContext& 
rRenderContext)
 svtools::ColorConfig aColorConfig;
 aColor = aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor;
 ApplyControlBackground(rRenderContext, aColor);
+// A hack to get it to change the non-ruler application background to 
change immediately
+if (aColor != maVirDev->GetBackground().GetColor())
+{
+maVirDev->SetBackground(aColor);
+Resize();
+}
 }
 
 void Ruler::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)


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

2022-01-26 Thread Caolán McNamara (via logerrit)
 svtools/source/control/ctrlbox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 26a750aac8e6bcf3d6d064ac6ef59005f95e34c3
Author: Caolán McNamara 
AuthorDate: Tue Jan 25 21:16:24 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 26 12:06:35 2022 +0100

give more wriggle room to avoid hitting max pixmap size with super hidpi

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 72b995d5ad83..1b27be221943 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -342,7 +342,7 @@ namespace
 gUserItemSz.setHeight(gUserItemSz.Height() * 16);
 gUserItemSz.setHeight(gUserItemSz.Height() / 10);
 
-size_t nMaxDeviceHeight = SAL_MAX_INT16 / 2; // see limitXCreatePixmap
+size_t nMaxDeviceHeight = SAL_MAX_INT16 / 16; // see 
limitXCreatePixmap and be generous wrt up to x16 hidpi
 gPreviewsPerDevice = nMaxDeviceHeight / gUserItemSz.Height();
 }
 }


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

2022-01-14 Thread Heiko Tietze (via logerrit)
 svtools/source/control/tabbar.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 90df5b09188c66c3a7752934650570246dfc321d
Author: Heiko Tietze 
AuthorDate: Fri Jan 14 10:44:02 2022 +0100
Commit: Heiko Tietze 
CommitDate: Fri Jan 14 13:43:00 2022 +0100

Resolve tdf#124572 - Draw a faint line between tabs

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

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index e910473de6e7..a62d0ae6fad9 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -137,10 +137,21 @@ public:
 mrRenderContext.DrawRect(maLineRect);
 }
 
+void drawSeparator()
+{
+const tools::Long cMargin = 5;
+const tools::Long aRight( maRect.Right() - 1 );
+mrRenderContext.SetLineColor(mrStyleSettings.GetShadowColor());
+mrRenderContext.DrawLine(Point(aRight, maRect.Top() + cMargin),
+ Point(aRight, maRect.Bottom() - cMargin));
+}
+
 void drawTab()
 {
 drawOuterFrame();
 drawColorLine();
+if (!mbSelected && !mbCustomColored)
+drawSeparator();
 if (mbProtect)
 {
 BitmapEx aBitmap(BMP_TAB_LOCK);


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

2021-12-25 Thread Noel Grandin (via logerrit)
 svtools/source/control/valueacc.cxx |   29 +
 svtools/source/control/valueimp.hxx |   11 ---
 2 files changed, 17 insertions(+), 23 deletions(-)

New commits:
commit 35267be7ce33c5203a76e8023382c287b2e1f180
Author: Noel Grandin 
AuthorDate: Fri Dec 24 11:51:29 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 25 16:52:14 2021 +0100

use comphelper::WeakComponentImplHelper in ValueSetAcc

and remove unnecessary use of SolarMutex, the fields
are already protected by mutex and the locked region
doesn't call into vcl.

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

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index d8f97826499f..23d3dcde9bc6 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -418,7 +418,6 @@ void ValueItemAcc::FireAccessibleEvent( short nEventId, 
const uno::Any& rOldValu
 }
 
 ValueSetAcc::ValueSetAcc( ValueSet* pParent ) :
-ValueSetAccComponentBase (m_aMutex),
 mpParent( pParent ),
 mbIsFocused(false)
 {
@@ -661,7 +660,7 @@ lang::Locale SAL_CALL ValueSetAcc::getLocale()
 void SAL_CALL ValueSetAcc::addAccessibleEventListener( const uno::Reference< 
accessibility::XAccessibleEventListener >& rxListener )
 {
 ThrowIfDisposed();
-::osl::MutexGuard aGuard (m_aMutex);
+std::unique_lock aGuard (m_aMutex);
 
 if( !rxListener.is() )
return;
@@ -685,7 +684,7 @@ void SAL_CALL ValueSetAcc::addAccessibleEventListener( 
const uno::Reference< acc
 void SAL_CALL ValueSetAcc::removeAccessibleEventListener( const 
uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
 {
 ThrowIfDisposed();
-::osl::MutexGuard aGuard (m_aMutex);
+std::unique_lock aGuard (m_aMutex);
 
 if( rxListener.is() )
 {
@@ -911,21 +910,19 @@ sal_Int64 SAL_CALL ValueSetAcc::getSomething( const 
uno::Sequence< sal_Int8 >& r
 }
 
 
-void SAL_CALL ValueSetAcc::disposing()
+void ValueSetAcc::disposing(std::unique_lock& rGuard)
 {
-::std::vector > 
aListenerListCopy;
+// Make a copy of the list and clear the original.
+::std::vector > 
aListenerListCopy = std::move(mxEventListeners);
 
-{
-// Make a copy of the list and clear the original.
-const SolarMutexGuard aSolarGuard;
-::osl::MutexGuard aGuard (m_aMutex);
-aListenerListCopy.swap(mxEventListeners);
-
-// Reset the pointer to the parent.  It has to be the one who has
-// disposed us because he is dying.
-mpParent = nullptr;
-}
+// Reset the pointer to the parent.  It has to be the one who has
+// disposed us because he is dying.
+mpParent = nullptr;
+
+if (aListenerListCopy.empty())
+return;
 
+rGuard.unlock();
 // Inform all listeners that this objects is disposing.
 lang::EventObject aEvent (static_cast(this));
 for (auto const& listenerCopy : aListenerListCopy)
@@ -974,7 +971,7 @@ ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) const
 
 void ValueSetAcc::ThrowIfDisposed()
 {
-if (rBHelper.bDisposed || rBHelper.bInDispose)
+if (m_bDisposed)
 {
 SAL_WARN("svx", "Calling disposed object. Throwing exception:");
 throw lang::DisposedException (
diff --git a/svtools/source/control/valueimp.hxx 
b/svtools/source/control/valueimp.hxx
index ca25ddbc12cf..4f9e9ec9c945 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -23,8 +23,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,7 +67,7 @@ struct ValueSetItem
 GetAccessible( bool bIsTransientChildrenDisabled );
 };
 
-typedef ::cppu::WeakComponentImplHelper<
+typedef comphelper::WeakComponentImplHelper<
 css::accessibility::XAccessible,
 css::accessibility::XAccessibleEventBroadcaster,
 css::accessibility::XAccessibleContext,
@@ -77,9 +76,7 @@ typedef ::cppu::WeakComponentImplHelper<
 css::lang::XUnoTunnel >
 ValueSetAccComponentBase;
 
-class ValueSetAcc :
-public ::cppu::BaseMutex,
-public ValueSetAccComponentBase
+class ValueSetAcc final : public ValueSetAccComponentBase
 {
 public:
 
@@ -156,7 +153,7 @@ private:
 /** Tell all listeners that the object is dying.  This callback is
 usually called from the WeakComponentImplHelper class.
 */
-virtual void SAL_CALL disposing() override;
+virtual void disposing(std::unique_lock&) override;
 
 /** Return the number of items.  This takes the None-Item into account.
 */


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

2021-12-21 Thread Andrea Gelmini (via logerrit)
 svtools/source/control/valueset.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 078d5c433e029389261220715e9984540658
Author: Andrea Gelmini 
AuthorDate: Tue Dec 21 21:24:20 2021 +0100
Commit: Julien Nabet 
CommitDate: Tue Dec 21 21:34:37 2021 +0100

Fix typo and removed duplicated comment

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index b3bd235ef249..e3551b77fdd4 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -767,9 +767,9 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 if (weld::DrawingArea* pNeedsFormatToScroll = !mnCols ? GetDrawingArea() : 
nullptr)
 {
 Format(pNeedsFormatToScroll->get_ref_device());
-// reset scrollbar so its set to the later calculated mnFirstLine on
+// reset scrollbar so it's set to the later calculated mnFirstLine on
 // the next Format
-RecalcScrollBar(); // reset scrollbar so its set to the later 
calculated
+RecalcScrollBar();
 }
 
 // if necessary scroll to the visible area


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

2021-12-16 Thread Noel Grandin (via logerrit)
 svtools/source/config/htmlcfg.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d505940a7fff8674ff4d22eaa04972a56bea516e
Author: Noel Grandin 
AuthorDate: Thu Dec 16 08:58:38 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 17 07:25:50 2021 +0100

tdf#146250 fix SvxHtmlOptions::IsDefaultTextEncoding

regression from
commit da9bba7cc3c243e936daea689fea64ecaf110f35
Author: Noel Grandin 
Date:   Mon Jul 26 10:10:17 2021 +0200
use officecfg for SvxHtmlOptions

spotted by himajin10

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

diff --git a/svtools/source/config/htmlcfg.cxx 
b/svtools/source/config/htmlcfg.cxx
index 8835b132bf05..b871881e0997 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -90,7 +90,8 @@ bool IsPrintLayoutExtension()
 bool IsDefaultTextEncoding()
 {
 std::optional x = 
officecfg::Office::Common::Filter::HTML::Export::Encoding::get();
-return bool(x);
+// if we have a value, then the text encoding is not default
+return !bool(x);
 }
 rtl_TextEncoding GetTextEncoding()
 {


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

2021-12-11 Thread Mike Kaganski (via logerrit)
 svtools/source/svrtf/svparser.cxx |   15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 89070c8021d483ec84a3b6f465543c733208b1dc
Author: Mike Kaganski 
AuthorDate: Sun Dec 12 09:17:27 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sun Dec 12 08:39:40 2021 +0100

Small simplification

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

diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index dd5068976ff7..ca0a8816851a 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -253,19 +253,10 @@ sal_uInt32 SvParser::GetNextChar()
 {
 const sal_uInt64 nPos = rInput.Tell();
 rInput.ReadUtf16(cUC);
-bErr = !rInput.good();
-if (!bErr)
-{
-if (rtl::isLowSurrogate(cUC))
-c = rtl::combineSurrogates(c, cUC);
-else
-rInput.Seek(nPos); // process lone high surrogate
-}
+if (rtl::isLowSurrogate(cUC)) // can only be true when 
ReadUtf16 succeeded
+c = rtl::combineSurrogates(c, cUC);
 else
-{
-bErr = false; // process lone high surrogate
-rInput.Seek(nPos); // maybe step 1 byte back
-}
+rInput.Seek(nPos); // process lone high surrogate
 }
 }
 }


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

2021-12-11 Thread Mike Kaganski (via logerrit)
 svtools/source/svrtf/svparser.cxx|   20 
 sw/qa/extras/htmlimport/data/emojis16BE.html |binary
 sw/qa/extras/htmlimport/htmlimport.cxx   |8 
 3 files changed, 28 insertions(+)

New commits:
commit 21154ea8c450f9f5568b32123d34a20e498a9290
Author: Mike Kaganski 
AuthorDate: Sat Dec 11 12:53:26 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sat Dec 11 12:21:57 2021 +0100

tdf#146173: combine non-BMP characters' surrogates correctly

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

diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index 0fec7a97097e..dd5068976ff7 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -247,7 +247,27 @@ sal_uInt32 SvParser::GetNextChar()
 rInput.ReadUtf16(cUC);
 bErr = !rInput.good();
 if( !bErr )
+{
 c = cUC;
+if (rtl::isHighSurrogate(cUC))
+{
+const sal_uInt64 nPos = rInput.Tell();
+rInput.ReadUtf16(cUC);
+bErr = !rInput.good();
+if (!bErr)
+{
+if (rtl::isLowSurrogate(cUC))
+c = rtl::combineSurrogates(c, cUC);
+else
+rInput.Seek(nPos); // process lone high surrogate
+}
+else
+{
+bErr = false; // process lone high surrogate
+rInput.Seek(nPos); // maybe step 1 byte back
+}
+}
+}
 }
 else
 {
diff --git a/sw/qa/extras/htmlimport/data/emojis16BE.html 
b/sw/qa/extras/htmlimport/data/emojis16BE.html
new file mode 100644
index ..023aee1cb20e
Binary files /dev/null and b/sw/qa/extras/htmlimport/data/emojis16BE.html differ
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx 
b/sw/qa/extras/htmlimport/htmlimport.cxx
index a8b9a4df65a4..00e2ec99191f 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -528,6 +528,14 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testOleImgSvg)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), xObjects->getCount());
 }
 
+CPPUNIT_TEST_FIXTURE(HtmlImportTest, testUTF16_nonBMP)
+{
+load(mpTestDocumentPath, "emojis16BE.html");
+// tdf#146173: non-BMP characters' surrogates didn't combine correctly
+CPPUNIT_ASSERT_EQUAL(OUString(u"a text with emojis:  ☀‍‍♂️酪"),
+ getParagraph(1)->getString());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-11-24 Thread Caolán McNamara (via logerrit)
 svtools/source/dialogs/ServerDetailsControls.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 51c735d5109c487fcb876379a16f170c19a98f93
Author: Caolán McNamara 
AuthorDate: Wed Nov 24 17:07:29 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 24 20:18:24 2021 +0100

Resolves: tdf#145840 call ToggledDavsHdl on setting checkbox state

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

diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx 
b/svtools/source/dialogs/ServerDetailsControls.cxx
index 52635afe2771..24a6de413ecb 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -172,11 +172,13 @@ bool DavDetailsContainer::verifyScheme( const OUString& 
rScheme )
 {
 bValid = true;
 m_pDialog->m_xCBDavs->set_active(false);
+ToggledDavsHdl(*m_pDialog->m_xCBDavs);
 }
 else if ( rScheme == "https://; )
 {
 bValid = true;
 m_pDialog->m_xCBDavs->set_active(true);
+ToggledDavsHdl(*m_pDialog->m_xCBDavs);
 }
 return bValid;
 }


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

2021-11-22 Thread Justin Luth (via logerrit)
 svtools/source/control/tabbar.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit fbda2f3b7b47021a140cbfd3288aa7de1b42e1fd
Author: Justin Luth 
AuthorDate: Sat Nov 20 20:29:17 2021 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 22 10:30:37 2021 +0100

tdf#132470 tabbar: revert back to bold font on visible tab

This is a partial regression to LO 6.3's
commit fad98c8641342a77241124dd98e0cb781daef4ad.

The current sheet is always selected, which is fairly
distinctive. However, it is possible to select
multiple sheets, and the current one should be
distinctly marked to differentiate it from
the other selected sheets.

Change-Id: Ib160535cccebcfcabee94d17e5941cc3cd23bb15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125601
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Tomaž Vajngerl 

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 65c1d27074b3..e910473de6e7 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1162,8 +1162,11 @@ void TabBar::Paint(vcl::RenderContext& rRenderContext, 
const tools::Rectangle& r
 aDrawer.mbProtect = pItem->mbProtect;
 aDrawer.drawTab();
 
-// actual page is drawn using a bold font
-rRenderContext.SetFont(aLightFont);
+// currently visible sheet is drawn using a bold font
+if (bCurrent)
+rRenderContext.SetFont(aFont);
+else
+rRenderContext.SetFont(aLightFont);
 
 // Set the correct FillInBrush depending on status
 


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

2021-11-18 Thread Noel Grandin (via logerrit)
 svtools/source/config/accessibilityoptions.cxx |   12 +++-
 svtools/source/config/colorcfg.cxx |   12 +++-
 svtools/source/config/extcolorcfg.cxx  |   12 +++-
 svtools/source/config/miscopt.cxx  |   10 ++
 svtools/source/config/slidesorterbaropt.cxx|   10 ++
 svtools/source/control/inettbc.cxx |   14 --
 6 files changed, 33 insertions(+), 37 deletions(-)

New commits:
commit 79db82976e3070b7889d2ec350dde3eff703ebe4
Author: Noel Grandin 
AuthorDate: Thu Nov 18 19:53:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 19 07:32:43 2021 +0100

rtl::Static->thread-safe static in svtools

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

diff --git a/svtools/source/config/accessibilityoptions.cxx 
b/svtools/source/config/accessibilityoptions.cxx
index 7debdf47327e..05c113478402 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -30,7 +30,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include "itemholder2.hxx"
@@ -71,8 +70,11 @@ sal_Int32 
SvtAccessibilityOptions::sm_nAccessibilityRefCount
 
 namespace
 {
-struct SingletonMutex
-: public rtl::Static< ::osl::Mutex, SingletonMutex > {};
+::osl::Mutex& SingletonMutex()
+{
+static ::osl::Mutex SINGLETON;
+return SINGLETON;
+}
 }
 
 
@@ -335,7 +337,7 @@ SvtAccessibilityOptions::SvtAccessibilityOptions()
 {
 if (!utl::ConfigManager::IsFuzzing())
 {
-::osl::MutexGuard aGuard( SingletonMutex::get() );
+::osl::MutexGuard aGuard( SingletonMutex() );
 if(!sm_pSingleImplConfig)
 {
 sm_pSingleImplConfig = new SvtAccessibilityOptions_Impl;
@@ -349,7 +351,7 @@ SvtAccessibilityOptions::SvtAccessibilityOptions()
 SvtAccessibilityOptions::~SvtAccessibilityOptions()
 {
 //EndListening( *sm_pSingleImplConfig, sal_True );
-::osl::MutexGuard aGuard( SingletonMutex::get() );
+::osl::MutexGuard aGuard( SingletonMutex() );
 if( !--sm_nAccessibilityRefCount )
 {
 //if( sm_pSingleImplConfig->IsModified() )
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index ec918014e98f..f72736afe6cb 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 
 
 using namespace utl;
@@ -54,8 +53,11 @@ namespace svtools
 static sal_Int32nColorRefCount_Impl = 0;
 namespace
 {
-struct ColorMutex_Impl
-: public rtl::Static< ::osl::Mutex, ColorMutex_Impl > {};
+::osl::Mutex& ColorMutex_Impl()
+{
+static ::osl::Mutex SINGLETON;
+return SINGLETON;
+}
 }
 
 ColorConfig_Impl*ColorConfig::m_pImpl = nullptr;
@@ -376,7 +378,7 @@ ColorConfig::ColorConfig()
 {
 if (utl::ConfigManager::IsFuzzing())
 return;
-::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
+::osl::MutexGuard aGuard( ColorMutex_Impl() );
 if ( !m_pImpl )
 {
 m_pImpl = new ColorConfig_Impl;
@@ -390,7 +392,7 @@ ColorConfig::~ColorConfig()
 {
 if (utl::ConfigManager::IsFuzzing())
 return;
-::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
+::osl::MutexGuard aGuard( ColorMutex_Impl() );
 m_pImpl->RemoveListener(this);
 if(!--nColorRefCount_Impl)
 {
diff --git a/svtools/source/config/extcolorcfg.cxx 
b/svtools/source/config/extcolorcfg.cxx
index e5767b0b1453..bdeda2d4e8b9 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 
 
 using namespace utl;
@@ -51,8 +50,11 @@ namespace svtools
 static sal_Int32nExtendedColorRefCount_Impl = 0;
 namespace
 {
-struct ColorMutex_Impl
-: public rtl::Static< ::osl::Mutex, ColorMutex_Impl > {};
+::osl::Mutex& ColorMutex_Impl()
+{
+static ::osl::Mutex SINGLETON;
+return SINGLETON;
+}
 }
 
 ExtendedColorConfig_Impl*ExtendedColorConfig::m_pImpl = nullptr;
@@ -506,7 +508,7 @@ IMPL_LINK( ExtendedColorConfig_Impl, 
DataChangedEventListener, VclSimpleEvent&,
 
 ExtendedColorConfig::ExtendedColorConfig()
 {
-::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
+::osl::MutexGuard aGuard( ColorMutex_Impl() );
 if ( !m_pImpl )
 m_pImpl = new ExtendedColorConfig_Impl;
 ++nExtendedColorRefCount_Impl;
@@ -515,7 +517,7 @@ ExtendedColorConfig::ExtendedColorConfig()
 
 ExtendedColorConfig::~ExtendedColorConfig()
 {
-::osl::MutexGuard aGuard( ColorMutex_Impl::get() );
+::osl::MutexGuard aGuard( ColorMutex_Impl() );
 EndListening( *m_pImpl);
 if(!--nExtendedColorRefCount_Impl)
 {
diff --git a/svtools/source/config/miscopt.cxx 

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

2021-11-17 Thread Stephan Bergmann (via logerrit)
 svtools/source/svhtml/parhtml.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit b2065d0ef6ee90387759fdd952fc4e509f264ed3
Author: Stephan Bergmann 
AuthorDate: Wed Nov 17 11:02:09 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 17 12:22:41 2021 +0100

Remove newly redundant break

...after 0047e38da8bdfe09360cc2a658283ad5e18986e7 "svtools: HTMLParser: 
don't
insert EOF into strings"

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

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index e96af0e732a7..8c9d7909602f 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -961,7 +961,6 @@ HtmlTokenId HTMLParser::GetNextRawToken()
 aEndToken.clear();
 nToken = HtmlTokenId::NONE;
 }
-break;
 }
 break;
 default:


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

2021-11-16 Thread Michael Stahl (via logerrit)
 svtools/source/svhtml/parhtml.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 0047e38da8bdfe09360cc2a658283ad5e18986e7
Author: Michael Stahl 
AuthorDate: Tue Nov 16 14:31:58 2021 +0100
Commit: Michael Stahl 
CommitDate: Tue Nov 16 17:50:07 2021 +0100

svtools: HTMLParser: don't insert EOF into strings

It's not a valid Unicode code point.

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

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index e38afaa8ec2b..e96af0e732a7 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -651,11 +651,7 @@ HtmlTokenId HTMLParser::ScanText( const sal_Unicode cBreak 
)
 {
 bContinue = false;
 }
-else
-{
-sTmpBuffer.appendUtf32( nNextCh );
-}
-
+// else: ignore, not a valid code point
 break;
 
 case '<':
@@ -967,7 +963,7 @@ HtmlTokenId HTMLParser::GetNextRawToken()
 }
 break;
 }
-[[fallthrough]];
+break;
 default:
 if (!linguistic::IsControlChar(nNextCh) || nNextCh == '\t')
 {


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

2021-11-16 Thread Michael Stahl (via logerrit)
 svtools/source/svhtml/parhtml.cxx   |6 +-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |6 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit a7116b890ccd6dd1721413b4de6591a8057668ef
Author: Michael Stahl 
AuthorDate: Tue Nov 16 14:28:15 2021 +0100
Commit: Michael Stahl 
CommitDate: Tue Nov 16 17:49:12 2021 +0100

ofz#40766 svtools, sw: HTMLParser: really stop inserting control chars

35d248cab1f0d4800f72abb5cb6afb56f40d9083 forgot to fix one place where
control characters were in a presumed XML declaration.

Another place looks missing where comments are handled, but it's not
clear if these can be passed on to Writer.

Revert the previous fix from commit
b3325ef8cdfc2c82eec34e747106f75a9fccb7e4.

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

diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index d9f64c4541d9..e38afaa8ec2b 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1058,6 +1058,7 @@ HtmlTokenId HTMLParser::GetNextToken_()
 sTmpBuffer.appendUtf32( nNextCh );
 nNextCh = GetNextChar();
 } while( '>' != nNextCh && '/' != nNextCh && 
!rtl::isAsciiWhiteSpace( nNextCh ) &&
+!linguistic::IsControlChar(nNextCh) &&
  IsParserWorking() && !rInput.eof() );
 
 if( !sTmpBuffer.isEmpty() )
@@ -1135,8 +1136,11 @@ HtmlTokenId HTMLParser::GetNextToken_()
 if( !bDone )
 sTmpBuffer.appendUtf32(nNextCh);
 }
-else
+else if (!linguistic::IsControlChar(nNextCh)
+|| nNextCh == '\r' || nNextCh == '\n' || 
nNextCh == '\t')
+{
 sTmpBuffer.appendUtf32(nNextCh);
+}
 if( !bDone )
 nNextCh = GetNextChar();
 }
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 0b2b7b8647f6..7948768e4352 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -559,10 +559,8 @@ namespace sw
 }
 case CH_TXT_ATR_FIELDSTART:
 {
-if (auto const pFieldMark = 
rIDMA.getFieldmarkAt(SwPosition(rTextNode, i)))
-startedFields.emplace(pFieldMark, false, 0, 0);
-else
-SAL_WARN("sw.core", "CH_TXT_ATR_FIELDSTART 
field mark missing");
+auto const 
pFieldMark(rIDMA.getFieldmarkAt(SwPosition(rTextNode, i)));
+startedFields.emplace(pFieldMark, false, 0, 0);
 break;
 }
 case CH_TXT_ATR_FIELDSEP:


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

2021-11-08 Thread Mike Kaganski (via logerrit)
 svtools/source/misc/unitconv.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d55b2631342bc7babf3709f2f83e0e502ebe4014
Author: Mike Kaganski 
AuthorDate: Tue Nov 9 09:22:43 2021 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 9 08:43:03 2021 +0100

tdf#145158: pre-multiply the value by factor before conversion

Otherwise it is rounded before multiplying. Prior to the regressing
commit cfff893b9c82843a90aac4ecdb3a3936721b74a0, it was calculating
in twips, and was only converted to points by dividing by 20 in the
end, which allowed to keep some precision.

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

diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx
index bdff583182b5..5e316c5adf46 100644
--- a/svtools/source/misc/unitconv.cxx
+++ b/svtools/source/misc/unitconv.cxx
@@ -186,8 +186,8 @@ tools::Long CalcToPoint( tools::Long nIn, MapUnit eUnit, 
sal_uInt16 nFactor )
 eUnit == MapUnit::MapMM ||
 eUnit == MapUnit::MapCM, "this unit is not implemented" );
 
-if (const auto eTo = MapToO3tlLength(eUnit); eTo != o3tl::Length::invalid)
-return o3tl::convert(nIn, eTo, o3tl::Length::pt) * nFactor;
+if (const auto eFrom = MapToO3tlLength(eUnit); eFrom != 
o3tl::Length::invalid)
+return o3tl::convert(nIn * static_cast(nFactor), eFrom, 
o3tl::Length::pt);
 return 0;
 }
 


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

2021-11-02 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |   32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

New commits:
commit b6ef68cdaa51ca5c9fdab40ade97f4a0f18da51b
Author: Caolán McNamara 
AuthorDate: Mon Nov 1 20:45:20 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 2 14:54:50 2021 +0100

keep showing focus rect on the first element during highlight

for the case nothing is selected but non-hover shows the bare focus
rect to indicate focus is in the valueset though nothing is truly
selected

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 2afd1dfdeb57..f8b0267316aa 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1178,13 +1178,9 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& 
rRenderContext)
 return;
 
 const bool bFocus = HasFocus();
-const bool bDrawSel = !mbNoSelection || mbHighlight;
 
-if (!bFocus && !bDrawSel)
-{
-ImplDrawItemText(rRenderContext, OUString());
+if (!bFocus && mbNoSelection && !mbHighlight)
 return;
-}
 
 tools::Rectangle aSelectedRect, aHoverRect;
 ValueSetItem* pSelectedItem = ImplGetDrawSelectItem(mnSelItemId, bFocus, 
aSelectedRect);
@@ -1192,12 +1188,26 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& 
rRenderContext)
 
 if (pSelectedItem)
 {
-const bool bHover = mnHighItemId && pSelectedItem == pHighlightItem;
-ImplDrawSelect(rRenderContext, aSelectedRect, pSelectedItem, bFocus, 
bDrawSel, true, bHover);
-}
-if (mnHighItemId && pHighlightItem && pSelectedItem != pHighlightItem)
-{
-ImplDrawSelect(rRenderContext, aHoverRect, pHighlightItem, false, 
bDrawSel, false, true);
+const bool bHover = pSelectedItem == pHighlightItem;
+ImplDrawSelect(rRenderContext, aSelectedRect, pSelectedItem, bFocus, 
!mbNoSelection, true, bHover);
+}
+if (pHighlightItem && (pSelectedItem != pHighlightItem || mbNoSelection))
+{
+// For the case that there isn't a selected item, but due to wanting to
+// show focus is in the valueset, the above block will have drawn the
+// first item with a focus rect. For that situation; if the valueset is
+// the thin WB_MENUSTYLEVALUESET case then blend this highlight border
+// on top of that focus rect and it will appear with a highlighted
+// focus rect. If it's the other case of a thicker border then redraw
+// the focus rect highlighted with the hover color.
+bool bDrawFocus;
+WinBits nStyle = GetStyle();
+if (nStyle & WB_MENUSTYLEVALUESET)
+bDrawFocus = false;
+else
+bDrawFocus = pSelectedItem == pHighlightItem && mbNoSelection;
+
+ImplDrawSelect(rRenderContext, aHoverRect, pHighlightItem, bDrawFocus, 
mbHighlight, false, true);
 }
 }
 


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

2021-10-27 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |  106 ++--
 1 file changed, 67 insertions(+), 39 deletions(-)

New commits:
commit 3c0d04344321db2f7dc1db13ea72590884704f9f
Author: Caolán McNamara 
AuthorDate: Wed Oct 27 12:20:11 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 27 16:45:33 2021 +0200

make fat valueset selection rectangles solid

as used in writer's bullets and numbering valuesets

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 13f2abfa0df5..0a73e0418c72 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -20,8 +20,11 @@
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1272,68 +1275,93 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& 
rRenderContext,
 }
 else
 {
-if (bDrawSel)
-{
-rRenderContext.SetLineColor(aDoubleColor);
-tools::PolyPolygon aPolyPoly(1);
-aPolyPoly.Insert(aRect);
-rRenderContext.DrawTransparent(aPolyPoly, nTransparencePercent);
-}
-if (mbDoubleSel)
+rRenderContext.SetLineColor(aDoubleColor);
+tools::Rectangle aFocusRect;
+
+if (!mbDoubleSel)
 {
-aRect.AdjustLeft( 1 );
-aRect.AdjustTop( 1 );
-aRect.AdjustRight( -1 );
-aRect.AdjustBottom( -1 );
+// an outer rectangle surrounding a "focus" rectangle, surrounding
+// an inner rectangle. Focus rectangle is always drawn, but 
rendered
+// empty when there is no focus. e.g. as seen in color valuesets
 if (bDrawSel)
 {
 tools::PolyPolygon aPolyPoly(1);
 aPolyPoly.Insert(aRect);
 rRenderContext.DrawTransparent(aPolyPoly, 
nTransparencePercent);
 }
-}
-aRect.AdjustLeft( 1 );
-aRect.AdjustTop( 1 );
-aRect.AdjustRight( -1 );
-aRect.AdjustBottom( -1 );
-tools::Rectangle aRect2 = aRect;
-aRect.AdjustLeft( 1 );
-aRect.AdjustTop( 1 );
-aRect.AdjustRight( -1 );
-aRect.AdjustBottom( -1 );
-if (bDrawSel)
-{
-tools::PolyPolygon aPolyPoly(1);
-aPolyPoly.Insert(aRect);
-rRenderContext.DrawTransparent(aPolyPoly, nTransparencePercent);
-}
-if (mbDoubleSel)
-{
+
 aRect.AdjustLeft( 1 );
 aRect.AdjustTop( 1 );
 aRect.AdjustRight( -1 );
 aRect.AdjustBottom( -1 );
+
+aFocusRect = aRect;
+
+aRect.AdjustLeft( 1 );
+aRect.AdjustTop( 1 );
+aRect.AdjustRight( -1 );
+aRect.AdjustBottom( -1 );
+
 if (bDrawSel)
 {
 tools::PolyPolygon aPolyPoly(1);
 aPolyPoly.Insert(aRect);
 rRenderContext.DrawTransparent(aPolyPoly, 
nTransparencePercent);
 }
-}
 
-if (bDrawSel)
-{
-rRenderContext.SetLineColor(aSingleColor);
+if (bDrawSel)
+rRenderContext.SetLineColor(aSingleColor);
+else
+rRenderContext.SetLineColor(COL_LIGHTGRAY);
+
+rRenderContext.DrawRect(aFocusRect);
 }
 else
 {
-rRenderContext.SetLineColor(COL_LIGHTGRAY);
+// a thick bordered rectangle surrounding an optional "focus"
+// rectangle which is only drawn when focused, as seen in format,
+// bullets and numbering in writer
+const int nAdjust = 2;
+
+aRect.AdjustLeft(nAdjust);
+aRect.AdjustTop(nAdjust);
+aRect.AdjustRight(-nAdjust);
+aRect.AdjustBottom(-nAdjust);
+
+aFocusRect = aRect;
+
+if (bDrawSel)
+{
+const basegfx::B2DPolygon aRectPoly(
+basegfx::utils::createPolygonFromRect(
+vcl::unotools::b2DRectangleFromRectangle(aRect)));
+
+const int nThickness = nAdjust * 2;
+
+if (!rRenderContext.DrawPolyLineDirect(basegfx::B2DHomMatrix(),
+   aRectPoly,
+   nThickness,
+   nTransparencePercent / 
100.0,
+   nullptr,
+   
basegfx::B2DLineJoin::Miter))
+{
+SAL_WARN("svtools", "presumably impossible in practice, 
but fallback to see something");
+

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

2021-10-27 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 56b0d05991391d7a885e6928138d5512cbbdfb47
Author: Caolán McNamara 
AuthorDate: Wed Oct 27 10:19:27 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 27 14:00:41 2021 +0200

remove highlight when mouse tracking is finished

don't just move it to the selected element, remove it

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index a2865562b37a..67378218fa3d 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -472,7 +472,7 @@ void ValueSet::ImplTracking(const Point& rPos)
 if( GetStyle() & WB_MENUSTYLEVALUESET || GetStyle() & WB_FLATVALUESET )
 mbHighlight = true;
 
-ImplHighlightItem( mnSelItemId, false );
+ImplHighlightItem( 0, false );
 }
 }
 


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

2021-10-27 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |   21 -
 1 file changed, 21 deletions(-)

New commits:
commit d212257f72d277f1da9fc20df0ac45f7f0060eaf
Author: Caolán McNamara 
AuthorDate: Tue Oct 26 17:11:19 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 27 14:00:23 2021 +0200

don't second guess the theme colors in valuesets

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 4993bb9a7a93..a2865562b37a 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1229,27 +1229,6 @@ sal_uInt16 ValueSet::ImplDrawSelect(vcl::RenderContext& 
rRenderContext, sal_uInt
 
 Color aDoubleColor(rStyleSettings.GetHighlightColor());
 Color aSingleColor(rStyleSettings.GetHighlightTextColor());
-if (!mbDoubleSel)
-{
-/*
-*  #99777# contrast enhancement for thin mode
-*/
-const Wallpaper& rWall = maVirDev->GetBackground();
-if (!rWall.IsBitmap() && ! rWall.IsGradient())
-{
-const Color& rBack = rWall.GetColor();
-if (rBack.IsDark() && ! aDoubleColor.IsBright())
-{
-aDoubleColor = COL_WHITE;
-aSingleColor = COL_BLACK;
-}
-else if (rBack.IsBright() && !aDoubleColor.IsDark())
-{
-aDoubleColor = COL_BLACK;
-aSingleColor = COL_WHITE;
-}
-}
-}
 
 // specify selection output
 WinBits nStyle = GetStyle();


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

2021-10-26 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |   25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

New commits:
commit 5714eb5fe369672cde2459e8fe4ec0169190dff0
Author: Caolán McNamara 
AuthorDate: Tue Oct 26 16:59:53 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 26 20:50:17 2021 +0200

grab focus if clicked on anywhere, not just on a specific value

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index c30ada1d4ba3..c2baa2d5a483 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -481,20 +481,27 @@ bool ValueSet::MouseButtonDown( const MouseEvent& 
rMouseEvent )
 {
 if (rMouseEvent.IsLeft() && !rMouseEvent.IsMod2())
 {
+bool bConsumed = false;
 ValueSetItem* pItem = ImplGetItem( ImplGetItem( 
rMouseEvent.GetPosPixel() ) );
-if (pItem)
+if (rMouseEvent.GetClicks() == 1)
 {
-if (rMouseEvent.GetClicks() == 1)
+if (pItem)
 {
-SelectItem( pItem->mnId );
-if (!(GetStyle() & WB_NOPOINTERFOCUS))
-GrabFocus();
+SelectItem(pItem->mnId);
+bConsumed = true;
 }
-else if ( rMouseEvent.GetClicks() == 2 )
-maDoubleClickHdl.Call( this );
-
-return true;
+if (!(GetStyle() & WB_NOPOINTERFOCUS))
+{
+GrabFocus();
+bConsumed = true;
+}
+}
+else if (pItem && rMouseEvent.GetClicks() == 2)
+{
+maDoubleClickHdl.Call(this);
+bConsumed = true;
 }
+return bConsumed;
 }
 
 return CustomWidgetController::MouseButtonDown( rMouseEvent );


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

2021-10-26 Thread Caolán McNamara (via logerrit)
 svtools/source/control/valueset.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 20572726601760dfc59422e25dd2e56aa4069291
Author: Caolán McNamara 
AuthorDate: Tue Oct 26 16:55:33 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 26 20:49:43 2021 +0200

don't do any work if we'll ignore it afterwards

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

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index ef3978715ef3..c30ada1d4ba3 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -479,10 +479,10 @@ void ValueSet::ImplTracking(const Point& rPos)
 
 bool ValueSet::MouseButtonDown( const MouseEvent& rMouseEvent )
 {
-if ( rMouseEvent.IsLeft() )
+if (rMouseEvent.IsLeft() && !rMouseEvent.IsMod2())
 {
 ValueSetItem* pItem = ImplGetItem( ImplGetItem( 
rMouseEvent.GetPosPixel() ) );
-if (pItem && !rMouseEvent.IsMod2())
+if (pItem)
 {
 if (rMouseEvent.GetClicks() == 1)
 {


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

2021-10-23 Thread Andrea Gelmini (via logerrit)
 svtools/source/brwbox/brwbox2.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 6dd75b17e084b55a8104099945bc39ef4663585b
Author: Andrea Gelmini 
AuthorDate: Fri Oct 22 23:15:37 2021 +0200
Commit: Julien Nabet 
CommitDate: Sat Oct 23 12:45:54 2021 +0200

Fix typo to complete commit 25278dc22ff6

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

diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index 0f1079b16678..98eb5e88d5da 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -781,19 +781,19 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const 
tools::Rectangle& _rRec
 Size aOverallAreaSize = _bForeignDevice ? _rRect.GetSize() : 
pDataWin->GetOutputSizePixel();
 Point aOverallAreaBRPos = _bForeignDevice ? _rRect.BottomRight() : Point( 
aOverallAreaSize.Width(), aOverallAreaSize.Height() );
 
-tools::Long nDataRowHeigt = GetDataRowHeight();
+tools::Long nDataRowHeight = GetDataRowHeight();
 
 // compute relative rows to redraw
 sal_uLong nRelTopRow = 0;
 sal_uLong nRelBottomRow = aOverallAreaSize.Height();
-if (!_bForeignDevice && nDataRowHeigt)
+if (!_bForeignDevice && nDataRowHeight)
 {
-nRelTopRow = (static_cast(_rRect.Top()) / nDataRowHeigt);
-nRelBottomRow = static_cast(_rRect.Bottom()) / 
nDataRowHeigt;
+nRelTopRow = (static_cast(_rRect.Top()) / nDataRowHeight);
+nRelBottomRow = static_cast(_rRect.Bottom()) / 
nDataRowHeight;
 }
 
 // cache frequently used values
-Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + 
aOverallAreaPos.Y() );
+Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeight + 
aOverallAreaPos.Y() );
 _rOut.SetLineColor( COL_WHITE );
 const AllSettings& rAllSets = _rOut.GetSettings();
 const StyleSettings  = rAllSets.GetStyleSettings();
@@ -810,7 +810,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const 
tools::Rectangle& _rRec
 // redraw the invalid fields
 for ( sal_uLong nRelRow = nRelTopRow;
   nRelRow <= nRelBottomRow && static_cast(nTopRow)+nRelRow 
< o3tl::make_unsigned(nRowCount);
-  ++nRelRow, aPos.AdjustY(nDataRowHeigt ) )
+  ++nRelRow, aPos.AdjustY(nDataRowHeight ) )
 {
 // get row
 // check valid area, to be on the safe side:
@@ -830,7 +830,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const 
tools::Rectangle& _rRec
 // #73325# don't paint the row outside the painting rectangle (DG)
 // prepare auto-highlight
 tools::Rectangle aRowRect( Point( _rRect.Left(), aPos.Y() ),
-Size( _rRect.GetSize().Width(), nDataRowHeigt ) );
+Size( _rRect.GetSize().Width(), nDataRowHeight ) );
 
 bool bRowSelected   =   !bHideSelect
 &&  IsRowSelected( nRow );
@@ -877,7 +877,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const 
tools::Rectangle& _rRec
 _rOut.SetFillColor( rHighlightFillColor );
 _rOut.SetLineColor();
 tools::Rectangle aFieldRect( aPos,
-Size( pCol->Width(), nDataRowHeigt ) );
+Size( pCol->Width(), nDataRowHeight ) );
 _rOut.DrawRect( aFieldRect );
 }
 
@@ -891,7 +891,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const 
tools::Rectangle& _rRec
 // clip the column's output to the field area
 if (_bForeignDevice)
 {   // (not necessary if painting onto the data window)
-Size aFieldSize(pCol->Width(), nDataRowHeigt);
+Size aFieldSize(pCol->Width(), nDataRowHeight);
 
 if (aPos.X() + aFieldSize.Width() > aOverallAreaBRPos.X())
 aFieldSize.setWidth( aOverallAreaBRPos.X() - aPos.X() 
);
@@ -938,7 +938,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const 
tools::Rectangle& _rRec
 _rOut.SetClipRegion();
 _rOut.Push( vcl::PushFlags::LINECOLOR );
 _rOut.SetLineColor( aDelimiterLineColor );
-tools::Long nY = aPos.Y() + nDataRowHeigt - 1;
+tools::Long nY = aPos.Y() + nDataRowHeight - 1;
 if (nY <= aOverallAreaBRPos.Y())
 _rOut.DrawLine( Point( nHLineX, nY ),
 Point( bVLines


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

2021-10-18 Thread Caolán McNamara (via logerrit)
 svtools/source/dialogs/PlaceEditDialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5acba60cbd97f2f181037cbd3ab049e7ebff5332
Author: Caolán McNamara 
AuthorDate: Sat Oct 16 21:59:29 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 18 11:07:30 2021 +0200

Related: tdf#145169 use "sftp" because that's a known Protocol

while "ssh" isn't by INetURLObject. If we use sftp then
Breadcrumb::SetURL would create legal breadcrumbs links in the "save
remote" dialog for new "add SSH" from the manage services menu

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

diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx 
b/svtools/source/dialogs/PlaceEditDialog.cxx
index 359d0d0f5327..d0c8b67d5de7 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -222,7 +222,7 @@ void PlaceEditDialog::InitDetails( )
 xFtpDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
 m_aDetailsContainers.push_back(xFtpDetails);
 
-std::shared_ptr 
xSshDetails(std::make_shared(this, 22, "ssh"));
+std::shared_ptr 
xSshDetails(std::make_shared(this, 22, "sftp"));
 xSshDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
 m_aDetailsContainers.push_back(xSshDetails);
 


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

2021-09-29 Thread Caolán McNamara (via logerrit)
 svtools/source/brwbox/brwbox2.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2db427f9e098439ef68ce309bd8b440160ff37a0
Author: Caolán McNamara 
AuthorDate: Wed Sep 29 12:29:32 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 29 14:41:21 2021 +0200

Resolves: tdf#73139 text defaulted to transparent in pdf export

set an initial explicit default text color to resolve this

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

diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index 504af9f6fdd9..7c0f81c9e662 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -647,6 +647,10 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& 
rPos, SystemTextColorFlag
 pDev->Push();
 pDev->SetMapMode();
 pDev->SetFont( aFont );
+if (nFlags & SystemTextColorFlags::Mono)
+pDev->SetTextColor(COL_BLACK);
+else
+pDev->SetTextColor(pDataWin->GetTextColor());
 
 // draw a frame
 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();


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

2021-08-30 Thread Mike Kaganski (via logerrit)
 svtools/source/control/tabbar.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 638acd81979f24262c29dc12e0289d7fc38fcd8b
Author: Mike Kaganski 
AuthorDate: Mon Aug 30 16:41:52 2021 +0200
Commit: Mike Kaganski 
CommitDate: Tue Aug 31 04:37:07 2021 +0200

tdf#144183: restore 'erase' that was accidentally dropped

... in d47ac2ebdb495b025eb26e17cbbe2509797c31f0

Change-Id: Ic4946b72a0ef599428af5b806754bda5f0906990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121282
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index ae2c0e0d3e43..4bca7ccbb99d 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1659,6 +1659,7 @@ void TabBar::MovePage(sal_uInt16 nPageId, sal_uInt16 
nNewPos)
 auto it = mpImpl->maItemList.begin();
 it += nPos;
 ImplTabBarItem aItem = std::move(*it);
+mpImpl->maItemList.erase(it);
 if (nNewPos < mpImpl->maItemList.size())
 {
 it = mpImpl->maItemList.begin();


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

2021-08-26 Thread Andreas Heinisch (via logerrit)
 svtools/source/table/tablecontrol_impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 02e48e4c27b2f55bd287717a12ebc68277878b75
Author: Andreas Heinisch 
AuthorDate: Wed Aug 25 16:50:50 2021 +0200
Commit: Andreas Heinisch 
CommitDate: Thu Aug 26 21:48:22 2021 +0200

tdf#143169 - Remove additional row header width

If the table control has row headings, add the extra row width only at
the beginning of each row and not at the end. Otherwise the renderer of
the table control adds an additional column with the width of the row
header of the table.

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

diff --git a/svtools/source/table/tablecontrol_impl.cxx 
b/svtools/source/table/tablecontrol_impl.cxx
index d0124e290ad2..fbfa551d2c87 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -516,7 +516,7 @@ namespace svt::table
 ColumnPositions::const_reverse_iterator loop = 
m_aColumnWidths.rbegin();
 do
 {
-aArea.SetRight( loop->getEnd() - nScrolledOutLeft + 
m_nRowHeaderWidthPixel );
+aArea.SetRight(loop->getEnd() - nScrolledOutLeft);
 ++loop;
 }
 while ( (   loop != m_aColumnWidths.rend() )


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

2021-08-24 Thread Caolán McNamara (via logerrit)
 svtools/source/svrtf/parrtf.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6f790c8b31360463670439e6857ea64f418ddfbd
Author: Caolán McNamara 
AuthorDate: Mon Aug 23 20:21:25 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 24 09:36:10 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index a11ec870cf4b..cbd3a97aad63 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -572,7 +572,7 @@ void SvRTFParser::ReadBitmapData()  { SkipGroup(); }
 
 SvParserState SvRTFParser::CallParser()
 {
-char cFirstCh;
+char cFirstCh(0);
 nNextChPos = rInput.Tell();
 rInput.ReadChar( cFirstCh );
 nNextCh = static_cast(cFirstCh);


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

2021-08-20 Thread Eike Rathke (via logerrit)
 svtools/source/misc/langtab.cxx |   38 +-
 1 file changed, 25 insertions(+), 13 deletions(-)

New commits:
commit 05924f9b2e651f545d8ceea883d9b1729257349d
Author: Eike Rathke 
AuthorDate: Fri Aug 20 23:17:27 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 21 01:58:59 2021 +0200

Use LanguageTagIcu::getDisplayName() for on-the-fly language list entries

So the for {tag} entries "too geeky" argument of spell-checker
dictionary developers and language enthusiasts will be moot in
future and we can stop adding 100 more tags if it's not for locale
data.

Change-Id: Ic44fe5b2f794ddb258e56ec073f310ccaf6e470d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120799
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 7bd30f365158..9981cf6862b3 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -29,8 +29,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -156,16 +159,25 @@ OUString ApplyLreOrRleEmbedding( const OUString  )
 return aRes;
 }
 
-static OUString lcl_getDescription( std::u16string_view rBcp47 )
+static OUString lcl_getDescription( const LanguageTag& rTag )
 {
-// Place in curly brackets, so all on-the-fly tags are grouped together at
-// the top of a listbox (but behind the "[None]" entry), and not sprinkled
-// all over, which alphabetically might make sense in an English UI only
-// anyway. Also a visual indicator that it is a programmatical name, IMHO.
-/* TODO: pulling descriptive names (language, script, country, subtags)
- * from liblangtag or ISO databases might be nice, but those are English
- * only. Maybe ICU, that has translations for language and country. */
-return OUString::Concat("{") + rBcp47 + "}";
+OUString aStr( LanguageTagIcu::getDisplayName( rTag, 
Application::GetSettings().GetUILanguageTag()));
+if (aStr.isEmpty() || aStr == rTag.getBcp47())
+{
+// Place in curly brackets, so all on-the-fly tags without display name
+// are grouped together at the top of a listbox (but behind the
+// "[None]" entry), and not sprinkled all over, which alphabetically
+// might make sense in an English UI only anyway. Also a visual
+// indicator that it is a programmatical name, IMHO.
+return OUString::Concat("{") + aStr + "}";
+}
+else
+{
+// The ICU display name might be identical to a predefined name or even
+// to another tag's ICU name; clarify that this is a generated name and
+// append the language tag in curly brackets to distinguish.
+return aStr + " {" + rTag.getBcp47() + "}";
+}
 }
 
 SvtLanguageTableImpl::SvtLanguageTableImpl()
@@ -193,7 +205,7 @@ SvtLanguageTableImpl::SvtLanguageTableImpl()
 aLang.setScriptType(LanguageTag::ScriptType(nType));
 sal_uInt32 nPos = FindIndex(nLangType);
 if (nPos == RESARRAY_INDEX_NOTFOUND)
-AddItem((aName.isEmpty() ? lcl_getDescription(rBcp47) : 
aName), nLangType);
+AddItem((aName.isEmpty() ? lcl_getDescription(aLang) : aName), 
nLangType);
 }
 }
 }
@@ -219,8 +231,8 @@ OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType ) const
 if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < GetEntryCount() )
 return m_aStrings[nPos].first;
 
-//Rather than return a fairly useless "Unknown" name, return a geeky but 
usable-in-a-pinch lang-tag
-OUString sLangTag( lcl_getDescription( 
LanguageTag::convertToBcp47(eType)));
+// Obtain from ICU, or a geeky but usable-in-a-pinch lang-tag.
+OUString sLangTag( lcl_getDescription( LanguageTag(eType)));
 SAL_WARN("svtools.misc", "Language: 0x"
 << std::hex << eType
 << " with unknown name, so returning lang-tag of: "
@@ -287,7 +299,7 @@ LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( 
sal_uInt32 nIndex )
 
 sal_uInt32 SvtLanguageTable::AddLanguageTag( const LanguageTag& rLanguageTag )
 {
-return theLanguageTable::get().AddItem( 
lcl_getDescription(rLanguageTag.getBcp47()),
+return theLanguageTable::get().AddItem( lcl_getDescription(rLanguageTag),
 rLanguageTag.getLanguageType());
 }
 


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

2021-08-03 Thread Noel Grandin (via logerrit)
 svtools/source/misc/templatefoldercache.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 86143150ac287d497d7b887435de580cfb8486b9
Author: Noel Grandin 
AuthorDate: Mon Aug 2 19:00:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 3 13:21:25 2021 +0200

osl::Mutex->std::mutex in TemplateFolderCacheImpl

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

diff --git a/svtools/source/misc/templatefoldercache.cxx 
b/svtools/source/misc/templatefoldercache.cxx
index df219f93fcf6..1faa04470f41 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -41,6 +41,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -384,7 +385,7 @@ namespace svt
 TemplateFolderContent   m_aPreviousState;   // the current 
state of the template dirs (as found on the HD)
 TemplateFolderContent   m_aCurrentState;// the previous 
state of the template dirs (as found in the cache file)
 
-osl::Mutex  m_aMutex;
+std::mutex  m_aMutex;
 // will be lazy inited; never access directly; use getOfficeInstDirs().
 uno::Reference< util::XOfficeInstallationDirectories > 
m_xOfficeInstDirs;
 
@@ -757,7 +758,7 @@ namespace svt
 {
 if ( !m_xOfficeInstDirs.is() )
 {
-osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 if ( !m_xOfficeInstDirs.is() )
 {
 uno::Reference< uno::XComponentContext > xCtx(


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

2021-08-02 Thread Noel Grandin (via logerrit)
 svtools/source/control/inettbc.cxx |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit e01df5ad80cd8f34a781631da6f24f38bce613c4
Author: Noel Grandin 
AuthorDate: Mon Aug 2 18:59:40 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 2 21:44:05 2021 +0200

osl::Mutex->std::mutex in SvtMatchContext_Impl

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

diff --git a/svtools/source/control/inettbc.cxx 
b/svtools/source/control/inettbc.cxx
index 5f8cf08eb72f..61940085eff1 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -52,6 +52,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -91,7 +92,7 @@ class SvtMatchContext_Impl: public salhelper::Thread
 boolbOnlyDirectories;
 boolbNoSelection;
 
-osl::Mutex mutex_;
+std::mutex mutex_;
 bool stopped_;
 css::uno::Reference< css::ucb::XCommandProcessor > processor_;
 sal_Int32 commandId_;
@@ -154,7 +155,7 @@ void SvtMatchContext_Impl::Stop()
 css::uno::Reference< css::ucb::XCommandProcessor > proc;
 sal_Int32 id(0);
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 if (!stopped_) {
 stopped_ = true;
 proc = processor_;
@@ -184,7 +185,7 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl, void*, 
void )
 {
 // avoid recursion through cancel button
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 if (stopped_) {
 // Completion was stopped, no display:
 return;
@@ -402,7 +403,7 @@ void SvtMatchContext_Impl::doExecute()
 ::osl::MutexGuard aGuard( theSvtMatchContextMutex::get() );
 {
 // have we been stopped while we were waiting for the mutex?
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 if (stopped_) {
 return;
 }
@@ -477,7 +478,7 @@ void SvtMatchContext_Impl::doExecute()
 sal_Int32 id = proc->createCommandIdentifier();
 try {
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 processor_ = proc;
 commandId_ = id;
 }
@@ -502,7 +503,7 @@ void SvtMatchContext_Impl::doExecute()
 proc2->releaseCommandIdentifier(id);
 }
 {
-osl::MutexGuard g(mutex_);
+std::lock_guard g(mutex_);
 processor_.clear();
 // At least the neon-based WebDAV UCP does not
 // properly support aborting commands, so 
return


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

2021-07-29 Thread Szymon Kłos (via logerrit)
 svtools/source/control/toolbarmenu.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 56e8d9dbbfb1915e8599f7b1bb24ba502e862198
Author: Szymon Kłos 
AuthorDate: Tue Jun 29 10:36:10 2021 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jul 29 14:37:49 2021 +0200

jsdialog: sidebar: don't close popups when first time used

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

diff --git a/svtools/source/control/toolbarmenu.cxx 
b/svtools/source/control/toolbarmenu.cxx
index e3234184e533..b507587fb017 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -147,7 +148,11 @@ void 
ToolbarPopupContainer::setPopover(std::unique_ptr xPopup)
 // move the WeldToolbarPopup contents into this toolbar so on-demand 
contents can appear inside a preexisting gtk popover
 // because the arrow for the popover is only enabled if there's a popover 
set
 m_xPopup->getTopLevel()->move(m_xPopup->getContainer(), 
m_xContainer.get());
-m_xPopup->GrabFocus();
+
+// in online LoseFocus event is fired due to this line and popup is closed
+// when first time opened any popup from not focused sidebar
+if (!comphelper::LibreOfficeKit::isActive())
+m_xPopup->GrabFocus();
 }
 
 void ToolbarPopupContainer::unsetPopover()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-26 Thread Noel Grandin (via logerrit)
 svtools/source/config/optionsdrawinglayer.cxx |   41 --
 1 file changed, 26 insertions(+), 15 deletions(-)

New commits:
commit 57ee7deddd0934dab58199cb1d0b95439e2ba6b3
Author: Noel Grandin 
AuthorDate: Mon Jul 26 11:32:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 26 12:49:48 2021 +0200

UBSAN fix

after
commit 28993c0a8d8628c650b661767fd8ab2228c507d9
Author: Noel Grandin 
Date:   Sun Jul 25 15:05:51 2021 +0200
use officecfg for drawing options

I had the IsAAPossibleOnThisSystem() check inverted, and I didn't quite
translate the existing IsAntiAliasing()/SetAntAliasing() logic correctly

Fixes CppunitTest_sc_jumbosheets_test failure noted at

https://gerrit.libreoffice.org/c/core/+/119481/5#message-747bde6ad4bdcf90d2ff51e8daa03cb0189e6355

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

diff --git a/svtools/source/config/optionsdrawinglayer.cxx 
b/svtools/source/config/optionsdrawinglayer.cxx
index c615a2f6b6a0..43a1d68544f5 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -32,12 +32,6 @@
 namespace SvtOptionsDrawinglayer
 {
 
-// helper
-bool IsAAPossibleOnThisSystem()
-{
-return !Application::GetDefaultDevice()->SupportsOperation( 
OutDevSupportType::TransparentRect );
-}
-
 bool IsOverlayBuffer()
 {
 return officecfg::Office::Common::Drawinglayer::OverlayBuffer::get();
@@ -126,19 +120,36 @@ sal_uInt32 GetMaximumPaperBottomMargin()
 }
 
 static std::mutex gaAntiAliasMutex;
-static bool bAntiAliasingInit = false;
-static bool bAntiAliasing = false;
+static bool gbAntiAliasingInit = false;
+static bool gbAntiAliasing = false;
+static bool gbAllowAAInit = false;
+static bool gbAllowAA = false;
 
-bool IsAntiAliasing()
+bool IsAAPossibleOnThisSystem()
 {
 std::lock_guard aGuard(gaAntiAliasMutex);
-if (!bAntiAliasingInit)
+if (!gbAllowAAInit)
+{
+gbAllowAAInit = true;
+gbAllowAA = Application::GetDefaultDevice()->SupportsOperation( 
OutDevSupportType::TransparentRect );
+}
+return gbAllowAA;
+}
+
+
+bool IsAntiAliasing()
+{
+bool bAntiAliasing;
 {
-bAntiAliasingInit = true;
-bAntiAliasing = 
officecfg::Office::Common::Drawinglayer::AntiAliasing::get()
-&& IsAAPossibleOnThisSystem();
+std::lock_guard aGuard(gaAntiAliasMutex);
+if (!gbAntiAliasingInit)
+{
+gbAntiAliasingInit = true;
+gbAntiAliasing = 
officecfg::Office::Common::Drawinglayer::AntiAliasing::get();
+}
+bAntiAliasing = gbAntiAliasing;
 }
-return bAntiAliasing;
+return bAntiAliasing && IsAAPossibleOnThisSystem();
 }
 
 /**
@@ -156,7 +167,7 @@ void SetAntiAliasing( bool bOn, bool bTemporary )
 officecfg::Office::Common::Drawinglayer::AntiAliasing::set(bOn, batch);
 batch->commit();
 }
-bAntiAliasing = bOn;
+gbAntiAliasing = bOn;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-23 Thread Julien Nabet (via logerrit)
 svtools/source/config/helpopt.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit cb2827f5f65324f309fa0e3c30d0b19ad237410e
Author: Julien Nabet 
AuthorDate: Fri Jul 23 23:00:54 2021 +0200
Commit: Julien Nabet 
CommitDate: Fri Jul 23 23:49:30 2021 +0200

Fix SvtHelpOptions_Impl::GetPropertyNames (svtools)

Regression from 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=ba4f191300779cbd9e536d11c02895541fef24be
use officecfg to retrieve help system

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

diff --git a/svtools/source/config/helpopt.cxx 
b/svtools/source/config/helpopt.cxx
index 2b5b2cb2bbd3..2a7afe9e4918 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -85,7 +85,6 @@ Sequence< OUString > const & 
SvtHelpOptions_Impl::GetPropertyNames()
 "ExtendedTip",
 "Tip",
 "Locale",
-"System",
 "BuiltInHelpNotInstalledPopUp"
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-23 Thread Noel Grandin (via logerrit)
 svtools/source/control/valueacc.cxx |6 +++---
 svtools/source/control/valueimp.hxx |3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 2d98ee5f14a3343a9103771861d26920a7109b30
Author: Noel Grandin 
AuthorDate: Thu Jul 22 21:53:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 23 09:32:31 2021 +0200

osl::Mutex->std::mutex in ValueItemAcc

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

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index a6364d784064..bca32029f785 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -73,7 +73,7 @@ ValueItemAcc::~ValueItemAcc()
 
 void ValueItemAcc::ParentDestroyed()
 {
-const ::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 mpParent = nullptr;
 }
 
@@ -261,7 +261,7 @@ lang::Locale SAL_CALL ValueItemAcc::getLocale()
 
 void SAL_CALL ValueItemAcc::addAccessibleEventListener( const uno::Reference< 
accessibility::XAccessibleEventListener >& rxListener )
 {
-const ::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 if( !rxListener.is() )
return;
@@ -284,7 +284,7 @@ void SAL_CALL ValueItemAcc::addAccessibleEventListener( 
const uno::Reference< ac
 
 void SAL_CALL ValueItemAcc::removeAccessibleEventListener( const 
uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
 {
-const ::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 if( rxListener.is() )
 {
diff --git a/svtools/source/control/valueimp.hxx 
b/svtools/source/control/valueimp.hxx
index b980cb1f5c90..707493443b75 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #define VALUESET_ITEM_NONEITEM  0xFFFE
@@ -199,7 +200,7 @@ private:
 
 ::std::vector< css::uno::Reference<
 css::accessibility::XAccessibleEventListener > >
mxEventListeners;
-::osl::Mutex
maMutex;
+std::mutex  
maMutex;
 ValueSetItem*mpParent;
 bool
mbIsTransientChildrenDisabled;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-19 Thread Noel Grandin (via logerrit)
 svtools/source/table/cellvalueconversion.cxx |  560 ---
 svtools/source/table/cellvalueconversion.hxx |   49 +-
 2 files changed, 286 insertions(+), 323 deletions(-)

New commits:
commit 6b018077789797490786f854fd725a4955715d6f
Author: Noel Grandin 
AuthorDate: Mon Jul 19 10:06:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 19 13:17:59 2021 +0200

no need for pimpl in CellValueConversion

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

diff --git a/svtools/source/table/cellvalueconversion.cxx 
b/svtools/source/table/cellvalueconversion.cxx
index 76a0a1395ffd..32e368864d3a 100644
--- a/svtools/source/table/cellvalueconversion.cxx
+++ b/svtools/source/table/cellvalueconversion.cxx
@@ -19,7 +19,6 @@
 
 #include "cellvalueconversion.hxx"
 
-#include 
 #include 
 #include 
 #include 
@@ -38,396 +37,339 @@
 
 #include 
 #include 
-#include 
 
 namespace svt
 {
+using namespace ::com::sun::star::uno;
+using ::com::sun::star::util::XNumberFormatter;
+using ::com::sun::star::util::NumberFormatter;
+using ::com::sun::star::util::XNumberFormatsSupplier;
+using ::com::sun::star::util::NumberFormatsSupplier;
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::lang::Locale;
+using ::com::sun::star::util::DateTime;
+using ::com::sun::star::util::XNumberFormatTypes;
 
+namespace NumberFormat = ::com::sun::star::util::NumberFormat;
 
-using namespace ::com::sun::star::uno;
-using ::com::sun::star::util::XNumberFormatter;
-using ::com::sun::star::util::NumberFormatter;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::NumberFormatsSupplier;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::util::XNumberFormatTypes;
+//= helper
 
-namespace NumberFormat = ::com::sun::star::util::NumberFormat;
+namespace
+{
+double lcl_convertDateToDays(sal_uInt16 const i_day, sal_uInt16 const i_month,
+ sal_Int16 const i_year)
+{
+tools::Long const nNullDateDays = ::Date::DateToDays(1, 1, 1900);
+tools::Long const nValueDateDays = ::Date::DateToDays(i_day, i_month, 
i_year);
 
+return nValueDateDays - nNullDateDays;
+}
 
-//= helper
+double lcl_convertTimeToDays(tools::Long const i_hours, tools::Long const 
i_minutes,
+ tools::Long const i_seconds, tools::Long const 
i_100thSeconds)
+{
+return tools::Time(i_hours, i_minutes, i_seconds, 
i_100thSeconds).GetTimeInDays();
+}
+}
 
-namespace
-{
+//= StandardFormatNormalizer
 
-double lcl_convertDateToDays( sal_uInt16 const i_day, sal_uInt16 const 
i_month, sal_Int16 const i_year )
-{
-tools::Long const nNullDateDays = ::Date::DateToDays( 1, 1, 1900 );
-tools::Long const nValueDateDays = ::Date::DateToDays( i_day, 
i_month, i_year );
+StandardFormatNormalizer::StandardFormatNormalizer(Reference 
const& i_formatter,
+   ::sal_Int32 const 
i_numberFormatType)
+: m_nFormatKey(0)
+{
+try
+{
+ENSURE_OR_THROW(i_formatter.is(), "StandardFormatNormalizer: no 
formatter!");
+Reference const 
xSupplier(i_formatter->getNumberFormatsSupplier(),
+  UNO_SET_THROW);
+Reference const 
xTypes(xSupplier->getNumberFormats(), UNO_QUERY_THROW);
+m_nFormatKey = xTypes->getStandardFormat(i_numberFormatType,
+ 
SvtSysLocale().GetLanguageTag().getLocale());
+}
+catch (const Exception&)
+{
+DBG_UNHANDLED_EXCEPTION("svtools.table");
+}
+}
 
-return nValueDateDays - nNullDateDays;
-}
+//= DoubleNormalization
 
+namespace
+{
+class DoubleNormalization : public StandardFormatNormalizer
+{
+public:
+explicit DoubleNormalization(Reference const& 
i_formatter)
+: StandardFormatNormalizer(i_formatter, NumberFormat::NUMBER)
+{
+}
 
-double lcl_convertTimeToDays( tools::Long const i_hours, tools::Long 
const i_minutes, tools::Long const i_seconds, tools::Long const i_100thSeconds )
-{
-return tools::Time( i_hours, i_minutes, i_seconds, i_100thSeconds 
).GetTimeInDays();
-}
+virtual double convertToDouble(Any const& i_value) const override
+{
+double returnValue = std::numeric_limits::quiet_NaN();
+OSL_VERIFY(i_value >>= returnValue);
+return returnValue;
+}
+};
 
-//= CellValueConversion_Data
-class StandardFormatNormalizer;
+//= IntegerNormalization
 
+class IntegerNormalization : public StandardFormatNormalizer
+{
+public:
+explicit IntegerNormalization(Reference const& 
i_formatter)
+: 

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

2021-07-15 Thread Caolán McNamara (via logerrit)
 svtools/source/control/ctrlbox.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a449b624b24515764a2a494e831583218ee54097
Author: Caolán McNamara 
AuthorDate: Thu Jul 15 15:28:09 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jul 15 17:35:36 2021 +0200

crashreporting: Crash seen in CachePreview from Idle UpdateHdl

the intent here is regenerate the previews if font settings changed
which should mean that we restart at index 0 and not continue from
the old index

https: 
//crashreport.libreoffice.org/stats/crash_details/a01c5fcd-983b-40ab-b90a-8ee90286e5b8

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

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 33364f5a32fb..b20b3cfdf703 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -357,8 +357,11 @@ IMPL_LINK(FontNameBox, SettingsChangedHdl, 
VclSimpleEvent&, rEvent, void)
 gFontPreviewVirDevs.clear();
 gRenderedFontNames.clear();
 calcCustomItemSize(*m_xComboBox);
-if (mbWYSIWYG)
+if (mbWYSIWYG && mpFontList && !mpFontList->empty())
+{
+mnPreviewProgress = 0;
 maUpdateIdle.Start();
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   6   >