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

2023-11-09 Thread Mike Kaganski (via logerrit)
 extensions/source/ole/olethread.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 7938b495947e4311924bea7724a24c10e363de42
Author: Mike Kaganski 
AuthorDate: Thu Nov 9 12:55:34 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Nov 9 12:31:28 2023 +0100

Downgrade expected failures in CoInitializeEx to SAL_INFO

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

diff --git a/extensions/source/ole/olethread.cxx 
b/extensions/source/ole/olethread.cxx
index 1580c0b7d44a..503f8bc096c1 100644
--- a/extensions/source/ole/olethread.cxx
+++ b/extensions/source/ole/olethread.cxx
@@ -34,14 +34,17 @@ void o2u_attachCurrentThread()
 {   // FIXME: is it a problem that this ends up in STA currently?
 assert(RPC_E_CHANGED_MODE == hr);
 // Let's find out explicitly what apartment mode we are in.
-SAL_WARN("extensions.olebridge", "CoInitializeEx failed"
- << (hr == RPC_E_CHANGED_MODE ? " (expectedly)" : "")
- << ": " << WindowsErrorStringFromHRESULT(hr));
+if (hr == RPC_E_CHANGED_MODE)
+SAL_INFO("extensions.olebridge", "CoInitializeEx failed 
(expectedly): "
+ << 
WindowsErrorStringFromHRESULT(hr));
+else
+SAL_WARN("extensions.olebridge",
+ "CoInitializeEx failed: " << 
WindowsErrorStringFromHRESULT(hr));
 APTTYPE nAptType;
 APTTYPEQUALIFIER nAptTypeQualifier;
 if (SUCCEEDED(CoGetApartmentType(, )))
 {
-SAL_WARN("extensions.olebridge",
+SAL_INFO("extensions.olebridge",
  "  Thread is in a "
  << (nAptType == APTTYPE_STA ? 
OUString("single-threaded") :
  (nAptType == APTTYPE_MTA ? 
OUString("multi-threaded") :


[Libreoffice-commits] core.git: extensions/source odk/examples

2023-09-07 Thread Hossein (via logerrit)
 extensions/source/activex/SOActionsApproval.cxx |   13 +++--
 extensions/source/activex/SOComWindowPeer.cxx   |   13 +++--
 extensions/source/activex/SODispatchInterceptor.cxx |   14 +++---
 odk/examples/OLE/activex/SOComWindowPeer.cpp|   13 +++--
 4 files changed, 12 insertions(+), 41 deletions(-)

New commits:
commit 7a643f40b4c76bc55f17c3137aad90dbf55463ea
Author: Hossein 
AuthorDate: Wed Sep 6 22:50:25 2023 +0200
Commit: Hossein 
CommitDate: Thu Sep 7 10:09:14 2023 +0200

Simplify condition in a loop over a single element

The loop was over an array which has only one element, so the
condition should also work directly with its only element.

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

diff --git a/extensions/source/activex/SOActionsApproval.cxx 
b/extensions/source/activex/SOActionsApproval.cxx
index 833e220ae183..6fd6d0888141 100644
--- a/extensions/source/activex/SOActionsApproval.cxx
+++ b/extensions/source/activex/SOActionsApproval.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// SOActionsApproval.cpp : Implementation of CHelpApp and DLL registration.
+// SOActionsApproval.cxx : Implementation of CHelpApp and DLL registration.
 
 #include 
 
@@ -31,15 +31,8 @@
 
 COM_DECLSPEC_NOTHROW STDMETHODIMP 
SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] = {
-_ISOActionsApproval,
-};
-
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
-{
-if (InlineIsEqualGUID(*arr[i], riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISOActionsApproval, riid))
+return S_OK;
 return S_FALSE;
 }
 
diff --git a/extensions/source/activex/SOComWindowPeer.cxx 
b/extensions/source/activex/SOComWindowPeer.cxx
index 6973bc173984..59510c24a7a7 100644
--- a/extensions/source/activex/SOComWindowPeer.cxx
+++ b/extensions/source/activex/SOComWindowPeer.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
+// SOComWindowPeer.cxx : Implementation of CHelpApp and DLL registration.
 
 #include 
 
@@ -30,15 +30,8 @@
 
 COM_DECLSPEC_NOTHROW STDMETHODIMP 
SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] = {
-_ISOComWindowPeer,
-};
-
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
-{
-if (InlineIsEqualGUID(*arr[i], riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISOComWindowPeer, riid))
+return S_OK;
 return S_FALSE;
 }
 
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx 
b/extensions/source/activex/SODispatchInterceptor.cxx
index af3d69e02ea9..97ea07568fde 100644
--- a/extensions/source/activex/SODispatchInterceptor.cxx
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-// SODispatchInterceptor.cpp : Implementation of CHelpApp and DLL registration.
+// SODispatchInterceptor.cxx : Implementation of CHelpApp and DLL registration.
 
 #include 
 
@@ -33,16 +33,8 @@
 
 COM_DECLSPEC_NOTHROW STDMETHODIMP 
SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] =
-{
-_ISODispatchInterceptor,
-};
-
-for (auto const  : arr)
-{
-if (InlineIsEqualGUID(*i,riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISODispatchInterceptor, riid))
+return S_OK;
 return S_FALSE;
 }
 
diff --git a/odk/examples/OLE/activex/SOComWindowPeer.cpp 
b/odk/examples/OLE/activex/SOComWindowPeer.cpp
index 7439593dd138..50c1d7e8b341 100644
--- a/odk/examples/OLE/activex/SOComWindowPeer.cpp
+++ b/odk/examples/OLE/activex/SOComWindowPeer.cpp
@@ -33,7 +33,7 @@
  *
  */
 
-// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
+// SOComWindowPeer.cxx : Implementation of CHelpApp and DLL registration.
 
 #include "stdafx2.h"
 #include "so_activex.h"
@@ -42,15 +42,8 @@
 
 STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
 {
-static const IID* arr[] = {
-_ISOComWindowPeer,
-};
-
-for (int i = 0; i < SAL_N_ELEMENTS(arr); i++)
-{
-if (InlineIsEqualGUID(*arr[i], riid))
-return S_OK;
-}
+if (InlineIsEqualGUID(IID_ISOComWindowPeer, riid))
+return S_OK;
 return S_FALSE;
 }
 


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

2023-07-28 Thread Venetia Furtado (via logerrit)
 extensions/source/abpilot/fieldmappingimpl.cxx |1 -
 sw/qa/api/SwXAutoTextContainer.cxx |3 ---
 sw/qa/api/SwXBookmark.cxx  |2 --
 sw/qa/api/SwXChapterNumbering.cxx  |2 --
 4 files changed, 8 deletions(-)

New commits:
commit c37e50f5f2be3acff1ed32f1a1bf18d0ed7d6bdf
Author: Venetia Furtado 
AuthorDate: Thu Jul 27 14:13:27 2023 -0600
Commit: Gabor Kelemen 
CommitDate: Fri Jul 28 10:54:18 2023 +0200

tdf#146619 Remove unused #includes from C/C++ files

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

diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx 
b/extensions/source/abpilot/fieldmappingimpl.cxx
index 0b747ecb89ae..35314045e918 100644
--- a/extensions/source/abpilot/fieldmappingimpl.cxx
+++ b/extensions/source/abpilot/fieldmappingimpl.cxx
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 
diff --git a/sw/qa/api/SwXAutoTextContainer.cxx 
b/sw/qa/api/SwXAutoTextContainer.cxx
index 838aa5e2adbe..7651c4360e9a 100644
--- a/sw/qa/api/SwXAutoTextContainer.cxx
+++ b/sw/qa/api/SwXAutoTextContainer.cxx
@@ -14,9 +14,6 @@
 
 #include 
 
-#include 
-
-#include 
 #include 
 #include 
 
diff --git a/sw/qa/api/SwXBookmark.cxx b/sw/qa/api/SwXBookmark.cxx
index 0d916cfc01de..185e0b53f1db 100644
--- a/sw/qa/api/SwXBookmark.cxx
+++ b/sw/qa/api/SwXBookmark.cxx
@@ -20,8 +20,6 @@
 #include 
 #include 
 
-#include 
-
 using namespace css;
 using namespace css::uno;
 
diff --git a/sw/qa/api/SwXChapterNumbering.cxx 
b/sw/qa/api/SwXChapterNumbering.cxx
index b8985e0ec92b..30dc352535c5 100644
--- a/sw/qa/api/SwXChapterNumbering.cxx
+++ b/sw/qa/api/SwXChapterNumbering.cxx
@@ -14,8 +14,6 @@
 
 #include 
 
-#include 
-
 #include 
 #include 
 #include 


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

2023-07-18 Thread Venetia Furtado (via logerrit)
 extensions/source/propctrlr/controlfontdialog.cxx   |2 
 extensions/source/propctrlr/editpropertyhandler.cxx |   62 ++--
 extensions/source/propctrlr/formcontroller.cxx  |   28 +
 extensions/source/propctrlr/inspectormodelbase.cxx  |   27 
 extensions/source/propctrlr/pcrcommon.hxx   |   12 ++-
 extensions/source/propctrlr/pcrunodialogs.cxx   |4 -
 6 files changed, 76 insertions(+), 59 deletions(-)

New commits:
commit 63a9b0bed08a68f3619cadf7b7cef0a087154c10
Author: Venetia Furtado 
AuthorDate: Tue Jul 4 20:01:41 2023 -0600
Commit: Tomaž Vajngerl 
CommitDate: Tue Jul 18 17:51:18 2023 +0200

tdf#145614 Convert #define to enum

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

diff --git a/extensions/source/propctrlr/controlfontdialog.cxx 
b/extensions/source/propctrlr/controlfontdialog.cxx
index 08088e074f76..9c3eddf4d1e2 100644
--- a/extensions/source/propctrlr/controlfontdialog.cxx
+++ b/extensions/source/propctrlr/controlfontdialog.cxx
@@ -39,7 +39,7 @@ namespace pcr
 :OGenericUnoDialog( _rxContext )
 ,m_pItemPoolDefaults(nullptr)
 {
-registerProperty(PROPERTY_INTROSPECTEDOBJECT, 
OWN_PROPERTY_ID_INTROSPECTEDOBJECT,
+registerProperty(PROPERTY_INTROSPECTEDOBJECT, 
static_cast(OwnPropertyId::INTROSPECTEDOBJECT),
 PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT,
 _xControlModel, cppu::UnoType::get());
 }
diff --git a/extensions/source/propctrlr/editpropertyhandler.cxx 
b/extensions/source/propctrlr/editpropertyhandler.cxx
index 8629abb82590..f063489e642c 100644
--- a/extensions/source/propctrlr/editpropertyhandler.cxx
+++ b/extensions/source/propctrlr/editpropertyhandler.cxx
@@ -25,11 +25,15 @@
 #include 
 #include 
 
-#define TEXTTYPE_SINGLELINE 0
-#define TEXTTYPE_MULTILINE  1
-#define TEXTTYPE_RICHTEXT   2
-
-
+namespace
+{
+enum class TextType
+{
+SINGLELINE = 0,
+MULTILINE  = 1,
+RICHTEXT   = 2
+};
+};
 namespace pcr
 {
 
@@ -91,21 +95,21 @@ namespace pcr
 
 case PROPERTY_ID_TEXTTYPE:
 {
-sal_Int32 nTextType = TEXTTYPE_SINGLELINE;
+TextType nTextType = TextType::SINGLELINE;
 bool bRichText = false;
 OSL_VERIFY( m_xComponent->getPropertyValue( PROPERTY_RICHTEXT 
) >>= bRichText );
 if ( bRichText )
-nTextType = TEXTTYPE_RICHTEXT;
+nTextType = TextType::RICHTEXT;
 else
 {
 bool bMultiLine = false;
 OSL_VERIFY( m_xComponent->getPropertyValue( 
PROPERTY_MULTILINE ) >>= bMultiLine );
 if ( bMultiLine )
-nTextType = TEXTTYPE_MULTILINE;
+nTextType = TextType::MULTILINE;
 else
-nTextType = TEXTTYPE_SINGLELINE;
+nTextType = TextType::SINGLELINE;
 }
-aReturn <<= nTextType;
+aReturn <<= static_cast(nTextType);
 }
 break;
 
@@ -150,13 +154,13 @@ namespace pcr
 {
 bool bMultiLine = false;
 bool bRichText = false;
-sal_Int32 nTextType = TEXTTYPE_SINGLELINE;
+sal_Int32 nTextType = 
static_cast(TextType::SINGLELINE);
 OSL_VERIFY( _rValue >>= nTextType );
-switch ( nTextType )
+switch ( static_cast(nTextType) )
 {
-case TEXTTYPE_SINGLELINE: bMultiLine = bRichText = false; 
break;
-case TEXTTYPE_MULTILINE:  bMultiLine = true; bRichText = 
false; break;
-case TEXTTYPE_RICHTEXT:   bMultiLine = true; bRichText = true; 
break;
+case TextType::SINGLELINE: bMultiLine = bRichText = false; 
break;
+case TextType::MULTILINE:  bMultiLine = true; bRichText = 
false; break;
+case TextType::RICHTEXT:   bMultiLine = true; bRichText = 
true; break;
 default:
 OSL_FAIL( "EditPropertyHandler::setPropertyValue: invalid 
text type!" );
 }
@@ -261,21 +265,23 @@ namespace pcr
 {
 case PROPERTY_ID_TEXTTYPE:
 {
-sal_Int32 nTextType = TEXTTYPE_SINGLELINE;
-getPropertyValue( PROPERTY_TEXTTYPE ) >>= nTextType;
+sal_Int32 nTextTypeInt = 
static_cast(TextType::SINGLELINE);
+getPropertyValue( PROPERTY_TEXTTYPE ) >>= nTextTypeInt;
+
+TextType nTextType = static_cast(nTextTypeInt);
 
 if ( impl_isSupportedProperty_nothrow( PROPERTY_ID_WORDBREAK ) )
-_rxInspectorUI->enablePropertyUI( PROPERTY_WORDBREAK,   
nTextType == 

[Libreoffice-commits] core.git: extensions/source forms/source

2023-05-18 Thread Julien Nabet (via logerrit)
 extensions/source/propctrlr/standardcontrol.cxx |3 ++-
 forms/source/xforms/datatypes.cxx   |4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 0138745f0206f348644fd6d47c7316c8190d711b
Author: Julien Nabet 
AuthorDate: Sun May 14 21:16:30 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu May 18 12:40:03 2023 +0200

tdf#155123: XML Form: Deleting parts of user defined data type impossible

2 parts:
1) in extensions/source/propctrlr/standardcontrol.cxx
if value retrieved from the field is 0, let's return an empty Any var.

2) forms/source/xforms/datatypes.cxx
Allow to select 0 in the spinbox for String and URI ("hyperlink") datatypes
to be homogeneous

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

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index 9468ecc56745..ad978253b076 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -499,7 +499,8 @@ namespace pcr
 if ( !getTypedControlWindow()->get_text().isEmpty() )
 {
 double nValue = impl_fieldValueToApiValue_nothrow( 
getTypedControlWindow()->get_value( m_eValueUnit ) );
-aPropValue <<= nValue;
+if (nValue)
+aPropValue <<= nValue;
 }
 return aPropValue;
 }
diff --git a/forms/source/xforms/datatypes.cxx 
b/forms/source/xforms/datatypes.cxx
index e81f40246425..c2612f65f0ca 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -514,7 +514,7 @@ namespace xforms
 {
 sal_Int32 nValue( 0 );
 OSL_VERIFY( _rNewValue >>= nValue );
-if ( nValue <= 0 )
+if ( nValue < 0 )
 _rErrorMessage = "Length limits must denote positive 
integer values.";
 // TODO/eforms: localize the error message
 }
@@ -635,7 +635,7 @@ namespace xforms
 {
 sal_Int32 nValue( 0 );
 OSL_VERIFY( _rNewValue >>= nValue );
-if ( nValue <= 0 )
+if ( nValue < 0 )
 _rErrorMessage = "Length limits must denote positive 
integer values.";
 // TODO/eforms: localize the error message
 }


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

2023-05-04 Thread Julien Nabet (via logerrit)
 extensions/source/propctrlr/eformspropertyhandler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24cf81f9bc1165d21657a710e717d1c967e2cef7
Author: Julien Nabet 
AuthorDate: Thu May 4 10:00:17 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu May 4 13:59:18 2023 +0200

extensions: adjust max possible for reserve in eformspropertyhandler

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

diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx 
b/extensions/source/propctrlr/eformspropertyhandler.cxx
index 93643dcaa4a3..cb206897f501 100644
--- a/extensions/source/propctrlr/eformspropertyhandler.cxx
+++ b/extensions/source/propctrlr/eformspropertyhandler.cxx
@@ -281,7 +281,7 @@ namespace pcr
 {
 if ( m_pHelper->canBindToAnyDataType() )
 {
-aProperties.reserve( 8 );
+aProperties.reserve(9);
 addStringPropertyDescription( aProperties, 
PROPERTY_XML_DATA_MODEL );
 addStringPropertyDescription( aProperties, 
PROPERTY_BINDING_NAME );
 addStringPropertyDescription( aProperties, 
PROPERTY_BIND_EXPRESSION );


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

2023-05-04 Thread Julien Nabet (via logerrit)
 extensions/source/propctrlr/eformspropertyhandler.cxx|2 +-
 extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5ed998cb2f6f7965f51c3d091048f83d454a5c5a
Author: Julien Nabet 
AuthorDate: Wed May 3 23:02:16 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu May 4 09:01:12 2023 +0200

extensions: reserve the right nb of elements for vectors

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

diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx 
b/extensions/source/propctrlr/eformspropertyhandler.cxx
index c907e0b0c861..93643dcaa4a3 100644
--- a/extensions/source/propctrlr/eformspropertyhandler.cxx
+++ b/extensions/source/propctrlr/eformspropertyhandler.cxx
@@ -281,7 +281,7 @@ namespace pcr
 {
 if ( m_pHelper->canBindToAnyDataType() )
 {
-aProperties.reserve( 7 );
+aProperties.reserve( 8 );
 addStringPropertyDescription( aProperties, 
PROPERTY_XML_DATA_MODEL );
 addStringPropertyDescription( aProperties, 
PROPERTY_BINDING_NAME );
 addStringPropertyDescription( aProperties, 
PROPERTY_BIND_EXPRESSION );
diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx 
b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
index 1f8351cdbcc5..7a3360423651 100644
--- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
+++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
@@ -171,7 +171,7 @@ namespace pcr
 
 if ( bAllowBinding )
 {
-aProperties.reserve( 12 );
+aProperties.reserve( 28 );
 
 addStringPropertyDescription( aProperties, 
PROPERTY_XSD_DATA_TYPE   );
 addInt16PropertyDescription ( aProperties, 
PROPERTY_XSD_WHITESPACES );


[Libreoffice-commits] core.git: extensions/source include/rtl sw/Library_sw.mk sw/source

2023-04-12 Thread Mike Kaganski (via logerrit)
 extensions/source/activex/StdAfx2.h |1 
 include/rtl/ustring.hxx |   23 ++
 sw/Library_sw.mk|1 
 sw/source/filter/html/css1atr.cxx   |  113 +-
 sw/source/filter/html/css1kywd.cxx  |  215 ---
 sw/source/filter/html/css1kywd.hxx  |  279 ++--
 sw/source/filter/html/svxcss1.cxx   |  131 +++-
 sw/source/filter/html/wrthtml.hxx   |   22 --
 8 files changed, 277 insertions(+), 508 deletions(-)

New commits:
commit 53a4b94d018820689e0b98d7fa0a92563e3971a1
Author: Mike Kaganski 
AuthorDate: Wed Apr 12 12:03:10 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 12 19:49:15 2023 +0200

Use more *string_view

OUString::equalsIgnoreAsciiCaseAscii and compareToIgnoreAsciiCaseAscii
taking string_view are added as overloads, rather than replacements to
the variants taking const char*, because the latter have benefit when
the passed C-style string's length is unknown, because these variants
don't pre-calculate the length.

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

diff --git a/extensions/source/activex/StdAfx2.h 
b/extensions/source/activex/StdAfx2.h
index ed889271aed8..b2ab095e91f3 100644
--- a/extensions/source/activex/StdAfx2.h
+++ b/extensions/source/activex/StdAfx2.h
@@ -55,6 +55,7 @@
 extern CComModule _Module;
 #include 
 #include 
+#undef min
 
 #if defined __clang__
 #pragma clang diagnostic pop
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 263cb71d74c9..c4869f43a8f0 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -35,6 +35,7 @@
 #include 
 
 #if defined LIBO_INTERNAL_ONLY
+#include 
 #include 
 #include 
 #endif
@@ -47,6 +48,7 @@
 
 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
 #include "config_global.h"
+#include "o3tl/safeint.hxx"
 #include "rtl/stringconcat.hxx"
 #endif
 
@@ -1307,6 +1309,15 @@ public:
 return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( 
pData->buffer, pData->length, asciiStr ) == 0;
 }
 
+#if defined LIBO_INTERNAL_ONLY
+bool equalsIgnoreAsciiCaseAscii( std::string_view asciiStr ) const
+{
+return o3tl::make_unsigned(pData->length) == asciiStr.length()
+   && rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
+  pData->buffer, pData->length, asciiStr.data(), 
asciiStr.length()) == 0;
+}
+#endif
+
 /**
   Compares two ASCII strings ignoring case
 
@@ -1330,6 +1341,18 @@ public:
 return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( 
pData->buffer, pData->length, asciiStr );
 }
 
+#if defined LIBO_INTERNAL_ONLY
+sal_Int32 compareToIgnoreAsciiCaseAscii( std::string_view asciiStr ) const
+{
+sal_Int32 nMax = std::min(asciiStr.length(), 
std::numeric_limits::max());
+sal_Int32 result = rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
+pData->buffer, pData->length, asciiStr.data(), nMax);
+if (result == 0 && o3tl::make_unsigned(pData->length) < 
asciiStr.length())
+result = -1;
+return result;
+}
+#endif
+
 /**
   Perform an ASCII lowercase comparison of two strings.
 
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 8a79be4f9e41..5abd6bb541d7 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -536,7 +536,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/filter/basflt/shellio \
 sw/source/filter/html/SwAppletImpl \
 sw/source/filter/html/css1atr \
-sw/source/filter/html/css1kywd \
 sw/source/filter/html/htmlatr \
 sw/source/filter/html/htmlbas \
 sw/source/filter/html/htmlcss1 \
diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 349891c0eb92..0f39024e11e3 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -254,7 +254,7 @@ public:
 
 }
 
-void SwHTMLWriter::OutCSS1_Property( const char *pProp,
+void SwHTMLWriter::OutCSS1_Property( std::string_view pProp,
  std::string_view sVal,
  const OUString *pSVal,
  std::optional oMode )
@@ -262,7 +262,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp,
 OString aPropertyValue(sVal);
 if (aPropertyValue.isEmpty() && pSVal)
 {
-aPropertyValue = pSVal->toUtf8();
+aPropertyValue = OUStringToOString(*pSVal, RTL_TEXTENCODING_UTF8);
 }
 if (IgnorePropertyForReqIF(mbReqIF, pProp, aPropertyValue, oMode))
 return;
@@ -373,10 +373,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp,
 else
 {
 // for STYLE-Tag print string directly
-if( !sVal.empty() )
-sOut.append(sVal);
-else if( pSVal )
-

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

2023-04-12 Thread Noel Grandin (via logerrit)
 extensions/source/abpilot/datasourcehandling.hxx |2 +-
 sd/source/ui/inc/unomodel.hxx|4 ++--
 sd/source/ui/inc/unopage.hxx |4 ++--
 sd/source/ui/unoidl/unocpres.hxx |2 +-
 sd/source/ui/unoidl/unolayer.hxx |2 +-
 sd/source/ui/unoidl/unopage.cxx  |2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 00a9b9bcd12bacafa2d81a11233b9c88669da6f1
Author: Noel Grandin 
AuthorDate: Wed Apr 12 10:18:13 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 12 13:47:18 2023 +0200

rename intern->internal

where appropriate

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

diff --git a/extensions/source/abpilot/datasourcehandling.hxx 
b/extensions/source/abpilot/datasourcehandling.hxx
index 485c3c15bd90..c6058e45e30a 100644
--- a/extensions/source/abpilot/datasourcehandling.hxx
+++ b/extensions/source/abpilot/datasourcehandling.hxx
@@ -163,7 +163,7 @@ namespace abp
 */
 boolhasTable( const OUString& _rTableName ) const;
 
-/// return the intern data source object
+/// return the internal data source object
 css::uno::Reference< css::beans::XPropertySet > getDataSource() const;
 
 
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 98d5c4473f9b..ba2602b86e60 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -133,7 +133,7 @@ public:
 
 static rtl::Reference< SdXImpressDocument > GetModel( SdDrawDocument const 
& rDoc );
 
-// intern
+// internal
 bool operator==( const SdXImpressDocument& rModel ) const { return mpDoc 
== rModel.mpDoc; }
 bool operator!=( const SdXImpressDocument& rModel ) const { return mpDoc 
!= rModel.mpDoc; }
 
@@ -406,7 +406,7 @@ public:
 virtual void SAL_CALL addEventListener( const css::uno::Reference< 
css::lang::XEventListener >& xListener ) override;
 virtual void SAL_CALL removeEventListener( const css::uno::Reference< 
css::lang::XEventListener >& aListener ) override;
 
-// intern
+// internal
 /// @throws std::exception
 SdPage* FindPage( std::u16string_view rName ) const;
 };
diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx
index b6a6f0d6d9b6..9a684b2cb496 100644
--- a/sd/source/ui/inc/unopage.hxx
+++ b/sd/source/ui/inc/unopage.hxx
@@ -93,7 +93,7 @@ public:
 SdGenericDrawPage(SdXImpressDocument* pModel, SdPage* pInPage, const 
SvxItemPropertySet* pSet);
 virtual ~SdGenericDrawPage() noexcept override;
 
-// intern
+// internal
 bool isValid() const { return (SvxDrawPage::mpPage != nullptr) && (mpModel 
!= nullptr); }
 
 SdPage* GetPage() const { return 
static_cast(SvxDrawPage::mpPage); }
@@ -286,7 +286,7 @@ public:
 SdPageLinkTargets( SdGenericDrawPage* pUnoPage ) noexcept;
 virtual ~SdPageLinkTargets() noexcept override;
 
-// intern
+// internal
 SdrObject* FindObject( std::u16string_view rName ) const noexcept;
 
 // XServiceInfo
diff --git a/sd/source/ui/unoidl/unocpres.hxx b/sd/source/ui/unoidl/unocpres.hxx
index e74dbe0e4436..f1630d461bdd 100644
--- a/sd/source/ui/unoidl/unocpres.hxx
+++ b/sd/source/ui/unoidl/unocpres.hxx
@@ -97,7 +97,7 @@ class SdXCustomPresentationAccess : public 
::cppu::WeakImplHelper< css::containe
 private:
 SdXImpressDocument& mrModel;
 
-// intern
+// internal
 inline SdCustomShowList* GetCustomShowList() const noexcept;
 SdCustomShow * getSdCustomShow( std::u16string_view Name ) const noexcept;
 
diff --git a/sd/source/ui/unoidl/unolayer.hxx b/sd/source/ui/unoidl/unolayer.hxx
index fe343bba438b..42f9b868341f 100644
--- a/sd/source/ui/unoidl/unolayer.hxx
+++ b/sd/source/ui/unoidl/unolayer.hxx
@@ -48,7 +48,7 @@ public:
 SdLayer(SdLayerManager* pLayerManager_, SdrLayer* pSdrLayer_);
 virtual ~SdLayer() noexcept override;
 
-// intern
+// internal
 SdrLayer* GetSdrLayer() const noexcept { return pLayer; }
 
 // XServiceInfo
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 87508052da87..6ff2958f85b9 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2815,7 +2815,7 @@ Any SAL_CALL SdMasterPage::getByIndex( sal_Int32 Index )
 return SdGenericDrawPage::getByIndex(Index);
 }
 
-// intern
+// internal
 void SdMasterPage::setBackground( const Any& rValue )
 {
 // we need at least a beans::XPropertySet


[Libreoffice-commits] core.git: extensions/source solenv/clang-format

2023-04-05 Thread Jani Saranpää (via logerrit)
 extensions/source/propctrlr/fontdialog.cxx  |  168 
 extensions/source/propctrlr/fontitemids.hxx |   48 
 solenv/clang-format/excludelist |1 
 3 files changed, 98 insertions(+), 119 deletions(-)

New commits:
commit cccfc2e705b3708854dc2de8bcc602fa45fdb5a8
Author: Jani Saranpää 
AuthorDate: Wed Mar 29 21:43:23 2023 +0300
Commit: Stephan Bergmann 
CommitDate: Wed Apr 5 13:35:05 2023 +0200

tdf#145614 Convert #define to enum in propctrlr/fontitemids.hxx

- Removed fontitemids.hxx and moved new enum definition inside cxx file to
optimize compiling.
- Removed non-existing fontitemids.hxx from clang format excludelist.

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

diff --git a/extensions/source/propctrlr/fontdialog.cxx 
b/extensions/source/propctrlr/fontdialog.cxx
index 997986e0f536..6abc01866943 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include "formstrings.hxx"
-#include "fontitemids.hxx"
 #include 
 #include 
 #include 
@@ -69,6 +68,35 @@ namespace pcr
 
 namespace {
 
+enum FontItemIds: sal_uInt16
+{
+CFID_FONT = 1,
+CFID_HEIGHT =   2,
+CFID_WEIGHT =   3,
+CFID_POSTURE =  4,
+CFID_LANGUAGE = 5,
+CFID_UNDERLINE =6,
+CFID_STRIKEOUT =7,
+CFID_WORDLINEMODE = 8,
+CFID_CHARCOLOR =9,
+CFID_RELIEF =   10,
+CFID_EMPHASIS = 11,
+
+CFID_CJK_FONT = 12,
+CFID_CJK_HEIGHT =   13,
+CFID_CJK_WEIGHT =   14,
+CFID_CJK_POSTURE =  15,
+CFID_CJK_LANGUAGE = 16,
+CFID_CASEMAP =  17,
+CFID_CONTOUR =  18,
+CFID_SHADOWED = 19,
+
+CFID_FONTLIST = 20,
+
+CFID_FIRST_ITEM_ID =CFID_FONT,
+CFID_LAST_ITEM_ID = CFID_FONTLIST
+};
+
 class OFontPropertyExtractor
 {
 protected:
@@ -216,32 +244,32 @@ namespace pcr
 sal_Int32 nColor32  = 
aPropExtractor.getInt32FontProperty(PROPERTY_TEXTCOLOR, 0);
 
 // build SfxItems with the values
-SvxFontItem aFontItem(static_cast(nFontFamily), 
aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
+SvxFontItem aFontItem(static_cast(nFontFamily), 
aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, 
FontItemIds::CFID_FONT);
 
 nFontHeight = static_cast(o3tl::convert(nFontHeight, 
o3tl::Length::pt, o3tl::Length::twip));
 
-SvxFontHeightItem 
aSvxFontHeightItem(static_cast(nFontHeight),100,CFID_HEIGHT);
+SvxFontHeightItem 
aSvxFontHeightItem(static_cast(nFontHeight),100,FontItemIds::CFID_HEIGHT);
 
 FontWeight  
eWeight=vcl::unohelper::ConvertFontWeight(nFontWeight);
 FontItalic  
eItalic=vcl::unohelper::ConvertFontSlant(nFontSlant);
 FontLineStyle
eUnderline=static_cast(nFontLineStyle);
 FontStrikeout   
eStrikeout=static_cast(nFontStrikeout);
 
-SvxWeightItem   aWeightItem(eWeight,CFID_WEIGHT);
-SvxPostureItem  aPostureItem(eItalic,CFID_POSTURE);
+SvxWeightItem   aWeightItem(eWeight,FontItemIds::CFID_WEIGHT);
+SvxPostureItem  
aPostureItem(eItalic,FontItemIds::CFID_POSTURE);
 
-SvxCrossedOutItem   aCrossedOutItem(eStrikeout,CFID_STRIKEOUT);
-SvxWordLineModeItem aWordLineModeItem(bWordLineMode, 
CFID_WORDLINEMODE);
+SvxCrossedOutItem   
aCrossedOutItem(eStrikeout,FontItemIds::CFID_STRIKEOUT);
+SvxWordLineModeItem aWordLineModeItem(bWordLineMode, 
FontItemIds::CFID_WORDLINEMODE);
 
-SvxUnderlineItemaUnderlineItem(eUnderline,CFID_UNDERLINE);
+SvxUnderlineItem
aUnderlineItem(eUnderline,FontItemIds::CFID_UNDERLINE);
 aUnderlineItem.SetColor(Color(ColorTransparency, nTextLineColor));
 
-SvxColorItem aSvxColorItem(Color(ColorTransparency, 
nColor32),CFID_CHARCOLOR);
-SvxLanguageItem 
aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), 
CFID_LANGUAGE);
+SvxColorItem aSvxColorItem(Color(ColorTransparency, 
nColor32),FontItemIds::CFID_CHARCOLOR);
+SvxLanguageItem 
aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), 
FontItemIds::CFID_LANGUAGE);
 
 // the 2 CJK props
-SvxCharReliefItem 
aFontReliefItem(static_cast(nFontRelief), CFID_RELIEF);
-SvxEmphasisMarkItem 
aEmphasisMarkitem(static_cast(nFontEmphasisMark), 
CFID_EMPHASIS);
+SvxCharReliefItem 

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

2023-03-27 Thread Mike Kaganski (via logerrit)
 extensions/source/propctrlr/eventhandler.cxx |   84 ---
 extensions/source/propctrlr/eventhandler.hxx |5 -
 2 files changed, 42 insertions(+), 47 deletions(-)

New commits:
commit 5ed8d20d5f846e916e8af6f58d55955d9657e749
Author: Mike Kaganski 
AuthorDate: Mon Mar 27 11:09:31 2023 +
Commit: Mike Kaganski 
CommitDate: Mon Mar 27 12:43:22 2023 +

Simplify EventDescription ctor

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

diff --git a/extensions/source/propctrlr/eventhandler.cxx 
b/extensions/source/propctrlr/eventhandler.cxx
index 136dcb35dac3..304b8e5ebf94 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -123,27 +123,23 @@ namespace pcr
 namespace PropertyAttribute = css::beans::PropertyAttribute;
 namespace FormComponentType = css::form::FormComponentType;
 
-EventDescription::EventDescription( EventId _nId, const char* 
_pListenerNamespaceAscii, const char* _pListenerClassAsciiName,
-const char* _pListenerMethodAsciiName, TranslateId 
pDisplayNameResId, OUString _sHelpId, OString _sUniqueBrowseId )
+EventDescription::EventDescription( EventId _nId, std::u16string_view 
listenerClassName,
+std::u16string_view listenerMethodName, TranslateId 
pDisplayNameResId, OUString _sHelpId, OString _sUniqueBrowseId )
 :sDisplayName(PcrRes( pDisplayNameResId ))
-,sListenerMethodName( OUString::createFromAscii( 
_pListenerMethodAsciiName ) )
+,sListenerClassName( listenerClassName )
+,sListenerMethodName( listenerMethodName )
 ,sHelpId(std::move( _sHelpId ))
 ,sUniqueBrowseId(std::move( _sUniqueBrowseId ))
 ,nId( _nId )
 {
-OUStringBuffer aQualifiedListenerClass( "com.sun.star." );
-aQualifiedListenerClass.appendAscii( _pListenerNamespaceAscii );
-aQualifiedListenerClass.append( "." );
-aQualifiedListenerClass.appendAscii( _pListenerClassAsciiName );
-sListenerClassName = aQualifiedListenerClass.makeStringAndClear();
 }
 
 namespace
 {
-#define DESCRIBE_EVENT( map, asciinamespace, asciilistener, 
asciimethod, id_postfix ) \
+#define DESCRIBE_EVENT( map, listener, method, id_postfix ) \
 map.emplace(  \
-asciimethod, \
-EventDescription( ++nEventId, asciinamespace, asciilistener, 
asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, 
UID_BRWEVT_##id_postfix ) )
+u"" method, \
+EventDescription( ++nEventId, u"com.sun.star." listener, u"" 
method, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix 
) )
 
 bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, 
EventDescription& _out_rDescription )
 {
@@ -151,39 +147,39 @@ namespace pcr
 EventMap aMap;
 sal_Int32 nEventId = 0;
 
-DESCRIBE_EVENT(aMap, "form", "XApproveActionListener", 
"approveAction",  APPROVEACTIONPERFORMED);
-DESCRIBE_EVENT(aMap, "awt",  "XActionListener",
"actionPerformed",ACTIONPERFORMED);
-DESCRIBE_EVENT(aMap, "form", "XChangeListener",
"changed",CHANGED);
-DESCRIBE_EVENT(aMap, "awt",  "XTextListener",  
"textChanged",TEXTCHANGED);
-DESCRIBE_EVENT(aMap, "awt",  "XItemListener",  
"itemStateChanged",   ITEMSTATECHANGED);
-DESCRIBE_EVENT(aMap, "awt",  "XFocusListener", 
"focusGained",FOCUSGAINED);
-DESCRIBE_EVENT(aMap, "awt",  "XFocusListener", 
"focusLost",  FOCUSLOST);
-DESCRIBE_EVENT(aMap, "awt",  "XKeyListener",   
"keyPressed", KEYTYPED);
-DESCRIBE_EVENT(aMap, "awt",  "XKeyListener",   
"keyReleased",KEYUP);
-DESCRIBE_EVENT(aMap, "awt",  "XMouseListener", 
"mouseEntered",   MOUSEENTERED);
-DESCRIBE_EVENT(aMap, "awt",  "XMouseMotionListener",   
"mouseDragged",   MOUSEDRAGGED);
-DESCRIBE_EVENT(aMap, "awt",  "XMouseMotionListener",   
"mouseMoved", MOUSEMOVED);
-DESCRIBE_EVENT(aMap, "awt",  "XMouseListener", 
"mousePressed",   MOUSEPRESSED);
-DESCRIBE_EVENT(aMap, "awt",  "XMouseListener", 
"mouseReleased",  MOUSERELEASED);
-DESCRIBE_EVENT(aMap, "awt",  "XMouseListener", 
"mouseExited",MOUSEEXITED);
-DESCRIBE_EVENT(aMap, "form", "XResetListener", 
"approveReset",   APPROVERESETTED);
-

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

2023-03-23 Thread Bayram Çiçek (via logerrit)
 extensions/source/bibliography/framectr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 71311f88f7d83d8669576a98d300780d3d8bd02a
Author: Bayram Çiçek 
AuthorDate: Sun Mar 12 01:18:15 2023 +0300
Commit: Andreas Heinisch 
CommitDate: Thu Mar 23 10:37:12 2023 +

tdf#146150: Use dispatch command in framectr.cxx

- "slot:5503" changed to ".uno:CloseDoc"

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

diff --git a/extensions/source/bibliography/framectr.cxx 
b/extensions/source/bibliography/framectr.cxx
index 98c06079d491..31fef580448b 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -481,7 +481,7 @@ void BibFrameController_Impl::dispatch(const util::URL& 
_rURL, const uno::Sequen
 {
 RemoveFilter();
 }
-else if( _rURL.Complete == "slot:5503" || aCommand == "CloseDoc" )
+else if( _rURL.Complete == ".uno:CloseDoc" || aCommand == "CloseDoc" )
 {
 Application::PostUserEvent( LINK( this, BibFrameController_Impl,
 DisposeHdl ) );


[Libreoffice-commits] core.git: extensions/source sc/source sd/source svx/inc

2023-03-15 Thread Yousef_Rabia (via logerrit)
 extensions/source/ole/servprov.cxx  |3 +--
 sc/source/ui/vba/vbaeventshelper.cxx|3 +--
 sd/source/ui/framework/configuration/ResourceId.cxx |3 +--
 svx/inc/sdr/primitive2d/primitivefactory2d.hxx  |2 +-
 4 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 08c283d63fa648f3db1ab6dddf9edb73f0c7194e
Author: Yousef_Rabia 
AuthorDate: Tue Mar 14 23:29:51 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Mar 15 10:49:54 2023 +

tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: I37b5056026f29d2619a4f9d3da9251924c7f5fdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148898
Reviewed-by: Stephan Bergmann 
Tested-by: Stephan Bergmann 

diff --git a/extensions/source/ole/servprov.cxx 
b/extensions/source/ole/servprov.cxx
index ea69be1d9fe2..f5a9323d361d 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -305,8 +305,7 @@ css::uno::Sequence 
OleConverter::getSupportedServiceNames()
 "com.sun.star.bridge.OleBridgeSupplier2",
 "com.sun.star.bridge.oleautomation.BridgeSupplier"};
 }
-return css::uno::Sequence{
-"com.sun.star.bridge.OleBridgeSupplierVar1"};
+return {"com.sun.star.bridge.OleBridgeSupplierVar1"};
 }
 
 // XInitialize 
--
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx 
b/sc/source/ui/vba/vbaeventshelper.cxx
index 199c5493ef0b..9cfb3ab31b08 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -626,8 +626,7 @@ OUString ScVbaEventsHelper::getImplementationName()
 
 css::uno::Sequence ScVbaEventsHelper::getSupportedServiceNames()
 {
-return css::uno::Sequence{
-"com.sun.star.script.vba.VBASpreadsheetEventProcessor"};
+return {"com.sun.star.script.vba.VBASpreadsheetEventProcessor"};
 }
 
 // protected --
diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx 
b/sd/source/ui/framework/configuration/ResourceId.cxx
index 1845b353f168..21d7e6932bad 100644
--- a/sd/source/ui/framework/configuration/ResourceId.cxx
+++ b/sd/source/ui/framework/configuration/ResourceId.cxx
@@ -384,8 +384,7 @@ sal_Bool ResourceId::supportsService(OUString const & 
ServiceName)
 
 css::uno::Sequence ResourceId::getSupportedServiceNames()
 {
-return css::uno::Sequence{
-"com.sun.star.drawing.framework.ResourceId"};
+return {"com.sun.star.drawing.framework.ResourceId"};
 }
 
 /** When eMode is DIRECTLY then the anchor of the called object and the
diff --git a/svx/inc/sdr/primitive2d/primitivefactory2d.hxx 
b/svx/inc/sdr/primitive2d/primitivefactory2d.hxx
index ffe099e609ef..eb1c8fd9b92f 100644
--- a/svx/inc/sdr/primitive2d/primitivefactory2d.hxx
+++ b/svx/inc/sdr/primitive2d/primitivefactory2d.hxx
@@ -61,7 +61,7 @@ public:
 
 css::uno::Sequence SAL_CALL getSupportedServiceNames() override
 {
-return css::uno::Sequence{ 
"com.sun.star.graphic.PrimitiveFactory2D" };
+return { "com.sun.star.graphic.PrimitiveFactory2D" };
 }
 };
 


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

2023-03-09 Thread Vinit Agarwal (via logerrit)
 extensions/source/update/check/updatecheck.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d898620cb47e0d794d4033fdfa13b049f972a9ff
Author: Vinit Agarwal 
AuthorDate: Tue Mar 7 02:59:57 2023 +0530
Commit: Hossein 
CommitDate: Thu Mar 9 19:44:36 2023 +

tdf#147021 - Use std::size() instead of SAL_N_ELEMENTS() macro

Modified updatecheck.cxx where SAL_N_ELEMENTS (nRetryInterval) was used
to get the size of the array. Now it is replaced with std::size().

Change-Id: Ib43ff3ecaeb8e853f14d5b0be45654596a817ec4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148367
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/extensions/source/update/check/updatecheck.cxx 
b/extensions/source/update/check/updatecheck.cxx
index 46a4d8dbeb61..3bde028f96b1 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -542,7 +542,7 @@ UpdateCheckThread::run()
 // Increase next by 15, 60, .. minutes
 static const sal_Int32 nRetryInterval[] = { 900, 3600, 14400, 
86400 };
 
-if( n < SAL_N_ELEMENTS(nRetryInterval) )
+if( n < std::size(nRetryInterval) )
 ++n;
 
 tv.Seconds = nRetryInterval[n-1];
@@ -657,7 +657,7 @@ DownloadThread::run()
 // Increase next by 1, 5, 15, 60, .. minutes
 static const sal_Int16 nRetryInterval[] = { 60, 300, 900, 3600 
};
 
-if( n < SAL_N_ELEMENTS(nRetryInterval) )
+if( n < std::size(nRetryInterval) )
 ++n;
 
 tv.Seconds = nRetryInterval[n-1];


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

2023-02-20 Thread Caolán McNamara (via logerrit)
 extensions/source/update/check/updatecheck.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 97ceff5bb949063f118835d67334aedf6d57420c
Author: Caolán McNamara 
AuthorDate: Mon Feb 20 11:03:41 2023 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 20 12:51:34 2023 +

cid#1521188 Uninitialized scalar variable

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

diff --git a/extensions/source/update/check/updatecheck.cxx 
b/extensions/source/update/check/updatecheck.cxx
index dd4aa29ce312..46a4d8dbeb61 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -650,8 +650,7 @@ DownloadThread::run()
 if( ! m_aDownload.start(m_aURL, aLocalFile, aDownloadDest ) )
 {
 // retry every 15s unless the dialog is not visible
-TimeValue tv;
-tv.Seconds = 15;
+TimeValue tv(15, 0);
 
 if( ! UpdateCheck::get()->isDialogShowing() )
 {


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

2022-12-21 Thread Stephan Bergmann (via logerrit)
 extensions/source/propctrlr/eformshelper.cxx |3 ++-
 extensions/source/propctrlr/propeventtranslation.cxx |   13 +
 extensions/source/propctrlr/propeventtranslation.hxx |6 +-
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 1a7ad0c10d286ce9ae2700ceb2fd50eed1fb43a4
Author: Stephan Bergmann 
AuthorDate: Wed Dec 21 15:44:35 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 22 06:56:41 2022 +

loplugin:unocast (pcr::PropertyEventTranslation)

(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

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

diff --git a/extensions/source/propctrlr/eformshelper.cxx 
b/extensions/source/propctrlr/eformshelper.cxx
index 40aceed5dfe7..c53b8eacc909 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -243,7 +244,7 @@ namespace pcr
 ::comphelper::OInterfaceIteratorHelper3 
aListenerIterator(m_aPropertyListeners);
 while ( aListenerIterator.hasMoreElements() )
 {
-PropertyEventTranslation* pTranslator = dynamic_cast< 
PropertyEventTranslation* >( aListenerIterator.next().get() );
+PropertyEventTranslation* pTranslator = 
comphelper::getFromUnoTunnel< PropertyEventTranslation >( 
aListenerIterator.next() );
 OSL_ENSURE( pTranslator, 
"EFormsHelper::impl_toggleBindingPropertyListening_throw: invalid listener 
element in my container!" );
 if ( !pTranslator )
 continue;
diff --git a/extensions/source/propctrlr/propeventtranslation.cxx 
b/extensions/source/propctrlr/propeventtranslation.cxx
index 736c1e06fca2..ce8e794f2211 100644
--- a/extensions/source/propctrlr/propeventtranslation.cxx
+++ b/extensions/source/propctrlr/propeventtranslation.cxx
@@ -20,6 +20,7 @@
 #include "propeventtranslation.hxx"
 
 #include 
+#include 
 
 
 namespace pcr
@@ -48,6 +49,18 @@ namespace pcr
 }
 
 
+sal_Int64 PropertyEventTranslation::getSomething(
+css::uno::Sequence const & aIdentifier)
+{
+return comphelper::getSomethingImpl(aIdentifier, this);
+}
+
+css::uno::Sequence const & 
PropertyEventTranslation::getUnoTunnelId() {
+static comphelper::UnoIdInit const id;
+return id.getSeq();
+}
+
+
 void SAL_CALL PropertyEventTranslation::propertyChange( const 
PropertyChangeEvent& evt )
 {
 if ( !m_xDelegator.is() )
diff --git a/extensions/source/propctrlr/propeventtranslation.hxx 
b/extensions/source/propctrlr/propeventtranslation.hxx
index 43155b8c67f9..92e143dfbbc2 100644
--- a/extensions/source/propctrlr/propeventtranslation.hxx
+++ b/extensions/source/propctrlr/propeventtranslation.hxx
@@ -20,6 +20,7 @@
 #pragma once
 
 #include 
+#include 
 #include 
 
 
@@ -29,7 +30,7 @@ namespace pcr
 
 //= PropertyEventTranslation
 
-typedef ::cppu::WeakImplHelper <   css::beans::XPropertyChangeListener
+typedef ::cppu::WeakImplHelper <   css::beans::XPropertyChangeListener, 
css::lang::XUnoTunnel
 >   PropertyEventTranslation_Base;
 
 class PropertyEventTranslation : public PropertyEventTranslation_Base
@@ -52,6 +53,9 @@ namespace pcr
 const css::uno::Reference< css::beans::XPropertyChangeListener >&
 getDelegator() const { return m_xDelegator; }
 
+sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & 
aIdentifier) override;
+static css::uno::Sequence const & getUnoTunnelId();
+
 protected:
 // XPropertyChangeListener
 virtual void SAL_CALL propertyChange( const 
css::beans::PropertyChangeEvent& evt ) override;


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

2022-12-21 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/handlerhelper.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit cb3108f860065928552a86cf8acc4b3a95718ecf
Author: Caolán McNamara 
AuthorDate: Wed Dec 21 14:10:10 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 21 23:59:19 2022 +

cid#1517812 Dereference null return value

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

diff --git a/extensions/source/propctrlr/handlerhelper.cxx 
b/extensions/source/propctrlr/handlerhelper.cxx
index 55ffb9182f48..dfa83ff0c6e8 100644
--- a/extensions/source/propctrlr/handlerhelper.cxx
+++ b/extensions/source/propctrlr/handlerhelper.cxx
@@ -292,9 +292,10 @@ namespace pcr
 std::unique_ptr PropertyHandlerHelper::makeBuilder(const 
OUString& rUIFile, const Reference& rContext)
 {
 Reference xWindow(rContext->getValueByName("BuilderParent"), 
UNO_QUERY_THROW);
-weld::TransportAsXWindow* rTunnel
+weld::TransportAsXWindow* pTunnel
 = comphelper::getFromUnoTunnel(xWindow);
-return Application::CreateBuilder(rTunnel->getWidget(), rUIFile);
+assert(pTunnel && "must exist");
+return Application::CreateBuilder(pTunnel->getWidget(), rUIFile);
 }
 
 void PropertyHandlerHelper::setBuilderParent(const 
css::uno::Reference& rContext, weld::Widget* 
pParent)


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

2022-12-21 Thread Stephan Bergmann (via logerrit)
 extensions/source/propctrlr/commoncontrol.hxx|   14 ++---
 extensions/source/propctrlr/formcomponenthandler.cxx |5 ++--
 extensions/source/propctrlr/standardcontrol.hxx  |   20 +--
 extensions/source/propctrlr/usercontrol.cxx  |   12 +++
 extensions/source/propctrlr/usercontrol.hxx  |   10 ++---
 5 files changed, 39 insertions(+), 22 deletions(-)

New commits:
commit 19dfdf86ad1f5b08041d8b7a9f196caf881231ab
Author: Stephan Bergmann 
AuthorDate: Wed Dec 21 11:07:18 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 21 11:58:06 2022 +

iloplugin:unocast (pcr::OFormattedNumericControl)

(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

(Making the base class pcr::CommonBehaviourControl TControlInterface 
template
parameter variadic required swapping it with the other TControlWindow 
template
parameter.)

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

diff --git a/extensions/source/propctrlr/commoncontrol.hxx 
b/extensions/source/propctrlr/commoncontrol.hxx
index 746f2f56f600..eb92980eaff2 100644
--- a/extensions/source/propctrlr/commoncontrol.hxx
+++ b/extensions/source/propctrlr/commoncontrol.hxx
@@ -107,13 +107,13 @@ namespace pcr
 @param TControlWindow
 a class which is derived from weld::Widget
 */
-template < class TControlInterface, class TControlWindow >
+template < class TControlWindow, class... TControlInterface >
 class CommonBehaviourControl:public ::cppu::BaseMutex
-,public ::cppu::WeakComponentImplHelper< 
TControlInterface >
+,public ::cppu::WeakComponentImplHelper< 
TControlInterface... >
 ,public CommonBehaviourControlHelper
 {
 protected:
-typedef ::cppu::WeakComponentImplHelper< TControlInterface >
ComponentBaseClass;
+typedef ::cppu::WeakComponentImplHelper< TControlInterface... >
ComponentBaseClass;
 
 inline CommonBehaviourControl(sal_Int16 nControlType,
   std::unique_ptr xBuilder,
@@ -179,8 +179,8 @@ namespace pcr
 };
 
 //= CommonBehaviourControl - implementation
-template< class TControlInterface, class TControlWindow >
-inline CommonBehaviourControl< TControlInterface, TControlWindow 
>::CommonBehaviourControl(sal_Int16 nControlType,
+template< class TControlWindow, class... TControlInterface >
+inline CommonBehaviourControl< TControlWindow, TControlInterface... 
>::CommonBehaviourControl(sal_Int16 nControlType,

std::unique_ptr xBuilder,

std::unique_ptr xWidget,

bool bReadOnly)
@@ -196,8 +196,8 @@ namespace pcr
 }
 }
 
-template< class TControlInterface, class TControlWindow >
-inline void CommonBehaviourControl< TControlInterface, TControlWindow 
>::impl_checkDisposed_throw()
+template< class TControlWindow, class... TControlInterface >
+inline void CommonBehaviourControl< TControlWindow, TControlInterface... 
>::impl_checkDisposed_throw()
 {
 if ( ComponentBaseClass::rBHelper.bDisposed )
 throw css::lang::DisposedException( OUString(), *this );
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index dd4f1302fc31..a4e76388a413 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -77,6 +77,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1708,7 +1709,7 @@ namespace pcr
 catch( const UnknownPropertyException& ) {}
 if ( xControl.is() )
 {
-OFormattedNumericControl* pControl = dynamic_cast< 
OFormattedNumericControl* >( xControl.get() );
+OFormattedNumericControl* pControl = 
comphelper::getFromUnoTunnel< OFormattedNumericControl >( xControl );
 DBG_ASSERT( pControl, 
"FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" );
 if (pControl)
 {
@@ -1754,7 +1755,7 @@ namespace pcr
 catch( const UnknownPropertyException& ) {}
 if ( xControl.is() )
 {
-OFormattedNumericControl* pControl = dynamic_cast< 
OFormattedNumericControl* >( xControl.get() );
+

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

2022-12-16 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/updatecheckjob.cxx |   42 +-
 1 file changed, 26 insertions(+), 16 deletions(-)

New commits:
commit dca6880983174b97bef60a570f0412a1753c79e8
Author: Stephan Bergmann 
AuthorDate: Fri Dec 16 12:19:31 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Dec 16 14:21:16 2022 +

Fix deadlock

...introduced with 73e062be1ff10e2dd889d9ec9c2d07b692077f62 "blind fix for 
some
7.4.3.2 crashes in UpdateCheckJob" (and wreaking havoc during
--enable-online-update `make check`)

Change-Id: Idde4e4fa8ab94dafa141eb740aba1d874de4717d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144320
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/extensions/source/update/check/updatecheckjob.cxx 
b/extensions/source/update/check/updatecheckjob.cxx
index bf30c1686842..b79c438108ee 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -96,8 +96,9 @@ public:
 virtual void SAL_CALL notifyTermination( lang::EventObject const & evt ) 
override;
 
 private:
-std::mutex m_mutex;
 uno::Reference  m_xContext;
+
+std::mutex m_mutex;
 uno::Reference< frame::XDesktop2 >  m_xDesktop;
 std::unique_ptr< InitUpdateCheckJobThread > m_pInitThread;
 
@@ -175,7 +176,6 @@ UpdateCheckJob::~UpdateCheckJob()
 uno::Any
 UpdateCheckJob::execute(const uno::Sequence& namedValues)
 {
-std::scoped_lock l(m_mutex);
 for ( sal_Int32 n=namedValues.getLength(); n-- > 0; )
 {
 if ( namedValues[ n ].Name == "DynamicData" )
@@ -207,10 +207,13 @@ UpdateCheckJob::execute(const 
uno::Sequence& namedValues)
 
 OUString aEventName = getValue< OUString > (aEnvironment, "EventName");
 
-m_pInitThread.reset(
-new InitUpdateCheckJobThread(
-m_xContext, aConfig,
-aEventName != "onFirstVisibleTask"));
+auto thread = std::make_unique(
+m_xContext, aConfig,
+aEventName != "onFirstVisibleTask");
+{
+std::scoped_lock l(m_mutex);
+m_pInitThread = std::move(thread);
+}
 
 return uno::Any();
 }
@@ -276,14 +279,18 @@ UpdateCheckJob::supportsService( OUString const & 
serviceName )
 // XEventListener
 void SAL_CALL UpdateCheckJob::disposing( lang::EventObject const & rEvt )
 {
-std::scoped_lock l(m_mutex);
-bool shutDown = ( rEvt.Source == m_xDesktop );
+css::uno::Reference desktop;
+{
+std::scoped_lock l(m_mutex);
+if ( rEvt.Source == m_xDesktop ) {
+std::swap(m_xDesktop, desktop);
+}
+}
 
-if ( shutDown && m_xDesktop.is() )
+if ( desktop.is() )
 {
 terminateAndJoinThread();
-m_xDesktop->removeTerminateListener( this );
-m_xDesktop.clear();
+desktop->removeTerminateListener( this );
 }
 }
 
@@ -295,12 +302,15 @@ void SAL_CALL UpdateCheckJob::queryTermination( 
lang::EventObject const & )
 
 void UpdateCheckJob::terminateAndJoinThread()
 {
-std::scoped_lock l(m_mutex);
-if (m_pInitThread != nullptr)
+std::unique_ptr thread;
+{
+std::scoped_lock l(m_mutex);
+std::swap(m_pInitThread, thread);
+}
+if (thread != nullptr)
 {
-m_pInitThread->setTerminating();
-m_pInitThread->join();
-m_pInitThread.reset();
+thread->setTerminating();
+thread->join();
 }
 }
 


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

2022-12-15 Thread Noel Grandin (via logerrit)
 extensions/source/update/check/updatecheckjob.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 73e062be1ff10e2dd889d9ec9c2d07b692077f62
Author: Noel Grandin 
AuthorDate: Thu Dec 15 19:28:12 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 16 06:34:35 2022 +

blind fix for some 7.4.3.2 crashes in UpdateCheckJob

I am guessing that state in this object is being touched from
multiple threads (since it is an UNO service object), and one or
more of the threads are consequently seeing inconsistent state.

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

diff --git a/extensions/source/update/check/updatecheckjob.cxx 
b/extensions/source/update/check/updatecheckjob.cxx
index 7fabb98bff4c..bf30c1686842 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -96,6 +96,7 @@ public:
 virtual void SAL_CALL notifyTermination( lang::EventObject const & evt ) 
override;
 
 private:
+std::mutex m_mutex;
 uno::Reference  m_xContext;
 uno::Reference< frame::XDesktop2 >  m_xDesktop;
 std::unique_ptr< InitUpdateCheckJobThread > m_pInitThread;
@@ -174,6 +175,7 @@ UpdateCheckJob::~UpdateCheckJob()
 uno::Any
 UpdateCheckJob::execute(const uno::Sequence& namedValues)
 {
+std::scoped_lock l(m_mutex);
 for ( sal_Int32 n=namedValues.getLength(); n-- > 0; )
 {
 if ( namedValues[ n ].Name == "DynamicData" )
@@ -274,6 +276,7 @@ UpdateCheckJob::supportsService( OUString const & 
serviceName )
 // XEventListener
 void SAL_CALL UpdateCheckJob::disposing( lang::EventObject const & rEvt )
 {
+std::scoped_lock l(m_mutex);
 bool shutDown = ( rEvt.Source == m_xDesktop );
 
 if ( shutDown && m_xDesktop.is() )
@@ -292,6 +295,7 @@ void SAL_CALL UpdateCheckJob::queryTermination( 
lang::EventObject const & )
 
 void UpdateCheckJob::terminateAndJoinThread()
 {
+std::scoped_lock l(m_mutex);
 if (m_pInitThread != nullptr)
 {
 m_pInitThread->setTerminating();


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

2022-11-24 Thread Caolán McNamara (via logerrit)
 extensions/source/update/ui/updatecheckui.cxx |3 
 include/vcl/menubarupdateicon.hxx |   17 ++-
 vcl/source/window/bubblewindow.cxx|  122 --
 3 files changed, 87 insertions(+), 55 deletions(-)

New commits:
commit f1d5143c2f66936104f8236cc83417853d39f873
Author: Caolán McNamara 
AuthorDate: Thu Nov 24 16:30:24 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 24 21:33:17 2022 +0100

Resolves: tdf#152157 show update icon on all menubars

and not just the active one, so they are of a consistent height with
eachother. BubbleWindow is only shown for the active one.

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

diff --git a/extensions/source/update/ui/updatecheckui.cxx 
b/extensions/source/update/ui/updatecheckui.cxx
index 6a4a151b1a98..f7f1f011363b 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -163,10 +163,7 @@ void SAL_CALL UpdateCheckUI::documentEventOccured(const 
document::DocumentEvent&
 SolarMutexGuard aGuard;
 
 if( rEvent.EventName == "OnPrepareViewClosing" )
-{
 maBubbleManager.RemoveBubbleWindow();
-maBubbleManager.RemoveMenuBarIcon();
-}
 }
 
 void SAL_CALL UpdateCheckUI::disposing(const lang::EventObject&)
diff --git a/include/vcl/menubarupdateicon.hxx 
b/include/vcl/menubarupdateicon.hxx
index a426da869553..8e04c3f65a72 100644
--- a/include/vcl/menubarupdateicon.hxx
+++ b/include/vcl/menubarupdateicon.hxx
@@ -37,8 +37,10 @@ private:
 OUString maBubbleText;
 Image maBubbleImage;
 VclPtr mpBubbleWin;
-VclPtr mpIconSysWin;
-VclPtr mpIconMBar;
+VclPtr mpActiveSysWin;
+VclPtr mpActiveMBar;
+std::vector> maIconMBars;
+std::vector maIconIDs;
 
 Link maWindowEventHdl;
 Link maApplicationEventHdl;
@@ -47,8 +49,6 @@ private:
 Timer maTimeoutTimer;
 Idle maWaitIdle;
 
-sal_uInt16 mnIconID;
-
 bool mbShowMenuIcon;
 bool mbShowBubble;
 bool mbBubbleChanged;
@@ -64,6 +64,12 @@ private:
 VclPtr GetBubbleWindow();
 void SetBubbleChanged();
 
+sal_uInt16 GetIconID(MenuBar* pMenuBar) const;
+
+void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl);
+void RemoveMenuBarIcon(MenuBar* pMenuBar);
+void RemoveMenuBarIcons();
+
 public:
 MenuBarUpdateIconManager();
 ~MenuBarUpdateIconManager();
@@ -82,9 +88,6 @@ public:
 const OUString& GetBubbleText() const { return maBubbleText; }
 
 void RemoveBubbleWindow();
-
-void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl);
-void RemoveMenuBarIcon();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/bubblewindow.cxx 
b/vcl/source/window/bubblewindow.cxx
index f1fad815466a..dd11dce12ae6 100644
--- a/vcl/source/window/bubblewindow.cxx
+++ b/vcl/source/window/bubblewindow.cxx
@@ -218,7 +218,6 @@ void BubbleWindow::RecalcTextRects()
 MenuBarUpdateIconManager::MenuBarUpdateIconManager()
 : maTimeoutTimer("MenuBarUpdateIconManager")
 , maWaitIdle("vcl MenuBarUpdateIconManager maWaitIdle")
-, mnIconID (0)
 , mbShowMenuIcon(false)
 , mbShowBubble(false)
 , mbBubbleChanged( false )
@@ -235,19 +234,27 @@ MenuBarUpdateIconManager::MenuBarUpdateIconManager()
 maWindowEventHdl = LINK(this, MenuBarUpdateIconManager, WindowEventHdl);
 }
 
+sal_uInt16 MenuBarUpdateIconManager::GetIconID(MenuBar* pMenuBar) const
+{
+auto aI = std::find(maIconMBars.begin(), maIconMBars.end(), pMenuBar);
+if (aI == maIconMBars.end())
+return 0;
+return maIconIDs[std::distance(maIconMBars.begin(), aI)];
+}
+
 VclPtr MenuBarUpdateIconManager::GetBubbleWindow()
 {
-if ( !mpIconSysWin )
+if (!mpActiveSysWin)
 return nullptr;
 
-tools::Rectangle aIconRect = mpIconMBar->GetMenuBarButtonRectPixel( 
mnIconID );
+tools::Rectangle aIconRect = 
mpActiveMBar->GetMenuBarButtonRectPixel(GetIconID(mpActiveMBar));
 if( aIconRect.IsEmpty() )
 return nullptr;
 
 auto pBubbleWin = mpBubbleWin;
 
 if ( !pBubbleWin ) {
-pBubbleWin = VclPtr::Create( mpIconSysWin, maBubbleTitle,
+pBubbleWin = VclPtr::Create( mpActiveSysWin, 
maBubbleTitle,
maBubbleText, maBubbleImage );
 mbBubbleChanged = false;
 }
@@ -275,11 +282,11 @@ IMPL_LINK(MenuBarUpdateIconManager, WindowEventHdl, 
VclWindowEvent&, rEvent, voi
 
 if ( VclEventId::ObjectDying == nEventID )
 {
-if ( mpIconSysWin == rEvent.GetWindow() )
+if (mpActiveSysWin == rEvent.GetWindow())
 {
-mpIconSysWin->RemoveEventListener( maWindowEventHdl );
 RemoveBubbleWindow();
-RemoveMenuBarIcon();
+mpActiveSysWin = nullptr;
+mpActiveMBar = nullptr;
 }
 }
 

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

2022-11-24 Thread Caolán McNamara (via logerrit)
 extensions/source/update/ui/updatecheckui.cxx |3 +
 include/vcl/menubarupdateicon.hxx |3 +
 vcl/source/window/bubblewindow.cxx|   43 ++
 3 files changed, 28 insertions(+), 21 deletions(-)

New commits:
commit 5dbb85ca6abfbc2b5353da1e3eb36c426fb62305
Author: Caolán McNamara 
AuthorDate: Thu Nov 24 12:57:44 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 24 17:29:17 2022 +0100

split RemoveBubbleWindow

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

diff --git a/extensions/source/update/ui/updatecheckui.cxx 
b/extensions/source/update/ui/updatecheckui.cxx
index 6a4462669090..6a4a151b1a98 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -164,7 +164,8 @@ void SAL_CALL UpdateCheckUI::documentEventOccured(const 
document::DocumentEvent&
 
 if( rEvent.EventName == "OnPrepareViewClosing" )
 {
-maBubbleManager.RemoveBubbleWindow(true);
+maBubbleManager.RemoveBubbleWindow();
+maBubbleManager.RemoveMenuBarIcon();
 }
 }
 
diff --git a/include/vcl/menubarupdateicon.hxx 
b/include/vcl/menubarupdateicon.hxx
index f9b2932aa55c..a426da869553 100644
--- a/include/vcl/menubarupdateicon.hxx
+++ b/include/vcl/menubarupdateicon.hxx
@@ -81,9 +81,10 @@ public:
 const OUString& GetBubbleTitle() const { return maBubbleTitle; }
 const OUString& GetBubbleText() const { return maBubbleText; }
 
-void RemoveBubbleWindow(bool bRemoveIcon);
+void RemoveBubbleWindow();
 
 void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl);
+void RemoveMenuBarIcon();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/bubblewindow.cxx 
b/vcl/source/window/bubblewindow.cxx
index 00a20714e0cf..f1fad815466a 100644
--- a/vcl/source/window/bubblewindow.cxx
+++ b/vcl/source/window/bubblewindow.cxx
@@ -266,7 +266,7 @@ VclPtr 
MenuBarUpdateIconManager::GetBubbleWindow()
 
 IMPL_LINK_NOARG(MenuBarUpdateIconManager, TimeOutHdl, Timer *, void)
 {
-RemoveBubbleWindow( false );
+RemoveBubbleWindow();
 }
 
 IMPL_LINK(MenuBarUpdateIconManager, WindowEventHdl, VclWindowEvent&, rEvent, 
void)
@@ -278,7 +278,8 @@ IMPL_LINK(MenuBarUpdateIconManager, WindowEventHdl, 
VclWindowEvent&, rEvent, voi
 if ( mpIconSysWin == rEvent.GetWindow() )
 {
 mpIconSysWin->RemoveEventListener( maWindowEventHdl );
-RemoveBubbleWindow( true );
+RemoveBubbleWindow();
+RemoveMenuBarIcon();
 }
 }
 else if ( VclEventId::WindowMenubarAdded == nEventID )
@@ -297,7 +298,10 @@ IMPL_LINK(MenuBarUpdateIconManager, WindowEventHdl, 
VclWindowEvent&, rEvent, voi
 {
 MenuBar *pMBar = static_cast(rEvent.GetData());
 if ( pMBar && ( pMBar == mpIconMBar ) )
-RemoveBubbleWindow( true );
+{
+RemoveBubbleWindow();
+RemoveMenuBarIcon();
+}
 }
 else if ( ( nEventID == VclEventId::WindowMove ) ||
   ( nEventID == VclEventId::WindowResize ) )
@@ -382,7 +386,7 @@ IMPL_LINK(MenuBarUpdateIconManager, HighlightHdl, 
MenuBarButtonCallbackArg&, rDa
 if ( rData.bHighlight )
 maWaitIdle.Start();
 else
-RemoveBubbleWindow(false);
+RemoveBubbleWindow();
 
 return false;
 }
@@ -401,7 +405,8 @@ MenuBarUpdateIconManager::~MenuBarUpdateIconManager()
 {
 Application::RemoveEventListener( maApplicationEventHdl );
 
-RemoveBubbleWindow(true);
+RemoveBubbleWindow();
+RemoveMenuBarIcon();
 }
 
 void MenuBarUpdateIconManager::SetShowMenuIcon(bool bShowMenuIcon)
@@ -412,7 +417,10 @@ void MenuBarUpdateIconManager::SetShowMenuIcon(bool 
bShowMenuIcon)
 if ( bShowMenuIcon )
 Application::PostUserEvent(LINK(this, MenuBarUpdateIconManager, 
UserEventHdl));
 else
-RemoveBubbleWindow( true );
+{
+RemoveBubbleWindow();
+RemoveMenuBarIcon();
+}
 }
 }
 
@@ -486,7 +494,8 @@ void MenuBarUpdateIconManager::AddMenuBarIcon(SystemWindow 
*pSysWin, bool bAddEv
 if ( bAddEventHdl && mpIconSysWin )
 mpIconSysWin->RemoveEventListener( maWindowEventHdl );
 
-RemoveBubbleWindow( true );
+RemoveBubbleWindow();
+RemoveMenuBarIcon();
 
 if ( pActiveMBar )
 {
@@ -526,19 +535,8 @@ void MenuBarUpdateIconManager::AddMenuBarIcon(SystemWindow 
*pSysWin, bool bAddEv
 }
 }
 
-void MenuBarUpdateIconManager::RemoveBubbleWindow( bool bRemoveIcon )
+void MenuBarUpdateIconManager::RemoveMenuBarIcon()
 {
-maWaitIdle.Stop();
-maTimeoutTimer.Stop();
-
-if ( mpBubbleWin )
-{
-mpBubbleWin.disposeAndClear();
-}
-
-if ( !bRemoveIcon )
-return;
-
 try {
 if ( mpIconMBar && ( 

[Libreoffice-commits] core.git: extensions/source sd/source svx/source sw/source vcl/source

2022-11-21 Thread Noel Grandin (via logerrit)
 extensions/source/dbpilots/controlwizard.cxx  |1 -
 extensions/source/dbpilots/controlwizard.hxx  |1 -
 sd/source/ui/animations/SlideTransitionPane.cxx   |4 
 sd/source/ui/inc/SlideTransitionPane.hxx  |2 --
 svx/source/sidebar/effect/EffectPropertyPanel.cxx |4 
 svx/source/sidebar/effect/EffectPropertyPanel.hxx |2 --
 sw/source/core/text/xmldump.cxx   |   11 +++
 vcl/source/fontsubset/ttcr.cxx|1 -
 vcl/source/fontsubset/ttcr.hxx|1 -
 9 files changed, 3 insertions(+), 24 deletions(-)

New commits:
commit 727141098b7d7bfed65e64d2062042269a8f6088
Author: Noel Grandin 
AuthorDate: Fri Nov 18 16:28:11 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 21 10:05:30 2022 +0100

loplugin:unusedfields start removing unused weld fields

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

diff --git a/extensions/source/dbpilots/controlwizard.cxx 
b/extensions/source/dbpilots/controlwizard.cxx
index 5b4ed61dee92..13fa2980683a 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -150,7 +150,6 @@ namespace dbp
 m_xFormDatasource = m_xBuilder->weld_label("datasource");
 m_xFormDatasourceLabel = m_xBuilder->weld_label("datasourcelabel");
 m_xFormTable = m_xBuilder->weld_label("formtable");
-m_xFormTableLabel = m_xBuilder->weld_label("formtablelabel");
 
 const OControlWizardContext& rContext = getContext();
 if ( rContext.bEmbedded )
diff --git a/extensions/source/dbpilots/controlwizard.hxx 
b/extensions/source/dbpilots/controlwizard.hxx
index cf55c655e574..22e7feca1a5b 100644
--- a/extensions/source/dbpilots/controlwizard.hxx
+++ b/extensions/source/dbpilots/controlwizard.hxx
@@ -49,7 +49,6 @@ namespace dbp
 std::unique_ptr m_xFormDatasource;
 std::unique_ptr m_xFormContentTypeLabel;
 std::unique_ptr m_xFormContentType;
-std::unique_ptr m_xFormTableLabel;
 std::unique_ptr m_xFormTable;
 std::unique_ptr m_xFrame;
 
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index 4e49dd8aaa5d..30ccf1a51a7b 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -413,9 +413,7 @@ constexpr sal_uInt16 nNoneId = 
std::numeric_limits::max();
 
 void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
 {
-mxFT_VARIANT = m_xBuilder->weld_label("variant_label");
 mxLB_VARIANT = m_xBuilder->weld_combo_box("variant_list");
-mxFT_duration = m_xBuilder->weld_label("duration_label");
 mxCBX_duration = 
m_xBuilder->weld_metric_spin_button("transition_duration", FieldUnit::SECOND);
 mxFT_SOUND = m_xBuilder->weld_label("sound_label");
 mxLB_SOUND = m_xBuilder->weld_combo_box("sound_list");
@@ -485,9 +483,7 @@ SlideTransitionPane::~SlideTransitionPane()
 removeListener();
 mxVS_TRANSITION_ICONSWin.reset();
 mxVS_TRANSITION_ICONS.reset();
-mxFT_VARIANT.reset();
 mxLB_VARIANT.reset();
-mxFT_duration.reset();
 mxCBX_duration.reset();
 mxFT_SOUND.reset();
 mxLB_SOUND.reset();
diff --git a/sd/source/ui/inc/SlideTransitionPane.hxx 
b/sd/source/ui/inc/SlideTransitionPane.hxx
index 2b6ea8f93c8b..2672bfa630ef 100644
--- a/sd/source/ui/inc/SlideTransitionPane.hxx
+++ b/sd/source/ui/inc/SlideTransitionPane.hxx
@@ -100,9 +100,7 @@ private:
 
 std::unique_ptr mxVS_TRANSITION_ICONS;
 std::unique_ptr mxVS_TRANSITION_ICONSWin;
-std::unique_ptr mxFT_VARIANT;
 std::unique_ptr mxLB_VARIANT;
-std::unique_ptr mxFT_duration;
 std::unique_ptr mxCBX_duration;
 std::unique_ptr mxFT_SOUND;
 std::unique_ptr mxLB_SOUND;
diff --git a/svx/source/sidebar/effect/EffectPropertyPanel.cxx 
b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
index 77e2dac11229..400dda997962 100644
--- a/svx/source/sidebar/effect/EffectPropertyPanel.cxx
+++ b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
@@ -34,8 +34,6 @@ EffectPropertyPanel::EffectPropertyPanel(weld::Widget* 
pParent, SfxBindings* pBi
  [this] { return GetFrameWeld(); }))
 , mxGlowTransparency(
   m_xBuilder->weld_metric_spin_button("LB_GLOW_TRANSPARENCY", 
FieldUnit::PERCENT))
-, mxFTRadiusSoftEdge(m_xBuilder->weld_label("radiussoftedge"))
-, mxFTRadiusGlow(m_xBuilder->weld_label("radiusglow"))
 , mxFTColor(m_xBuilder->weld_label("glowcolorlabel"))
 , 
mxSoftEdgeRadius(m_xBuilder->weld_metric_spin_button("SB_SOFTEDGE_RADIUS", 
FieldUnit::POINT))
 {
@@ -47,11 +45,9 @@ EffectPropertyPanel::~EffectPropertyPanel()
 mxGlowRadius.reset();
 mxLBGlowColor.reset();
 mxGlowTransparency.reset();
-mxFTRadiusSoftEdge.reset();
 

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

2022-11-05 Thread Stephan Bergmann (via logerrit)
 extensions/source/scanner/grid.cxx|6 +++---
 extensions/source/scanner/sanedlg.cxx |   16 
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 47ef2aa3709b248475e9c462667434f59f4cf2cd
Author: Stephan Bergmann 
AuthorDate: Sat Nov 5 15:57:31 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Nov 5 18:27:41 2022 +0100

-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): extensions

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

diff --git a/extensions/source/scanner/grid.cxx 
b/extensions/source/scanner/grid.cxx
index c727c8c92a5a..0082d04e5def 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -18,9 +18,9 @@
  */
 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -446,7 +446,7 @@ void GridWindow::drawGrid(vcl::RenderContext& 
rRenderContext)
 drawLine(rRenderContext, fX, m_fMinY, fX, m_fMaxY);
 // draw tickmarks
 Point aPt = transform(fX, m_fMinY);
-std::sprintf(pBuf, "%g", fX);
+o3tl::sprintf(pBuf, "%g", fX);
 OUString aMark(pBuf, strlen(pBuf), osl_getThreadTextEncoding());
 Size aTextSize(rRenderContext.GetTextWidth(aMark), 
rRenderContext.GetTextHeight());
 aPt.AdjustX( -(aTextSize.Width() / 2) );
@@ -459,7 +459,7 @@ void GridWindow::drawGrid(vcl::RenderContext& 
rRenderContext)
 drawLine(rRenderContext, m_fMinX, fY, m_fMaxX, fY);
 // draw tickmarks
 Point aPt = transform(m_fMinX, fY);
-std::sprintf(pBuf, "%g", fY);
+o3tl::sprintf(pBuf, "%g", fY);
 OUString aMark(pBuf, strlen(pBuf), osl_getThreadTextEncoding());
 Size aTextSize(rRenderContext.GetTextWidth(aMark), 
rRenderContext.GetTextHeight());
 aPt.AdjustX( -(aTextSize.Width() + 2) );
diff --git a/extensions/source/scanner/sanedlg.cxx 
b/extensions/source/scanner/sanedlg.cxx
index 8486195c93e6..63c8ea79050f 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -745,7 +745,7 @@ IMPL_LINK(SaneDlg, ModifyHdl, weld::Entry&, rEdit, void)
 fValue = mfMin;
 else if( fValue > mfMax )
 fValue = mfMax;
-sprintf( pBuf, "%g", fValue );
+o3tl::sprintf( pBuf, "%g", fValue );
 mxNumericEdit->set_text( OUString( pBuf, strlen(pBuf), 
osl_getThreadTextEncoding() ) );
 }
 mrSane.SetOptionValue( mnCurrentOption, fValue, mnCurrentElement );
@@ -757,7 +757,7 @@ IMPL_LINK(SaneDlg, ModifyHdl, weld::Entry&, rEdit, void)
 if( mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement ))
 {
 char pBuf[256];
-sprintf( pBuf, "%g", fValue );
+o3tl::sprintf( pBuf, "%g", fValue );
 OUString aValue( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
 mxNumericEdit->set_text( aValue );
 mxQuantumRangeBox->set_active_text( aValue );
@@ -1002,13 +1002,13 @@ void SaneDlg::EstablishQuantumRange()
 mfMax = mpRange[ nValues-1 ];
 for( int i = 0; i < nValues; i++ )
 {
-sprintf( pBuf, "%g", mpRange[ i ] );
+o3tl::sprintf( pBuf, "%g", mpRange[ i ] );
 mxQuantumRangeBox->append_text( OUString( pBuf, strlen(pBuf), 
osl_getThreadTextEncoding() ) );
 }
 double fValue;
 if( mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement ) 
)
 {
-sprintf( pBuf, "%g", fValue );
+o3tl::sprintf( pBuf, "%g", fValue );
 mxQuantumRangeBox->set_active_text( OUString( pBuf, strlen(pBuf), 
osl_getThreadTextEncoding() ) );
 }
 mxQuantumRangeBox->show();
@@ -1033,12 +1033,12 @@ void SaneDlg::EstablishNumericOption()
 aText += mrSane.GetOptionUnitName( mnCurrentOption );
 if( mfMin != mfMax )
 {
-sprintf( pBuf, " < %g ; %g >", mfMin, mfMax );
+o3tl::sprintf( pBuf, " < %g ; %g >", mfMin, mfMax );
 aText += OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
 }
 mxOptionDescTxt->set_label( aText );
 mxOptionDescTxt->show();
-sprintf( pBuf, "%g", fValue );
+o3tl::sprintf( pBuf, "%g", fValue );
 mxNumericEdit->set_text( OUString( pBuf, strlen(pBuf), 
osl_getThreadTextEncoding() ) );
 mxNumericEdit->show();
 }
@@ -1398,7 +1398,7 @@ void SaneDlg::SaveState()
 break;
 if( n > 0 )
 aString.append(':');
-sprintf( buf, "%lg", fValue );
+o3tl::sprintf( buf, "%lg", fValue );
 

[Libreoffice-commits] core.git: extensions/source forms/source toolkit/source vcl/source

2022-09-08 Thread Juan C. Sanz (via logerrit)
 extensions/source/propctrlr/standardcontrol.cxx |4 ++--
 forms/source/component/Date.cxx |2 +-
 toolkit/source/controls/unocontrolmodel.cxx |4 ++--
 toolkit/source/controls/unocontrols.cxx |4 ++--
 vcl/source/app/weldutils.cxx|4 ++--
 vcl/source/control/field2.cxx   |4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 5d40ced9e8b0aa1e4c07aea56ed8c1bdaa89705f
Author: Juan C. Sanz 
AuthorDate: Thu Sep 8 00:14:39 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 8 10:24:01 2022 +0200

Revert "tdf#150569 Modify hardcoded dates to extend the range of accepted 
dates"

This reverts commit b20594f2fc8f6f9fdbf0b257b4e74d95a8d90139.

Reason for revert: Further testing has shown some errors in other ways of 
displaying the data

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

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index 1c88f98ecf8c..95b4143c76b8 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -99,8 +99,8 @@ namespace pcr
 m_xEntryFormatter.reset(new weld::DateFormatter(*m_xEntry));
 
 m_xEntryFormatter->SetStrictFormat(true);
-m_xEntryFormatter->SetMin(::Date(1, 1, 0001));
-m_xEntryFormatter->SetMax(::Date(31, 12, ));
+m_xEntryFormatter->SetMin(::Date(1, 1, 1600));
+m_xEntryFormatter->SetMax(::Date(1, 1, ));
 
 
m_xEntryFormatter->SetExtDateFormat(ExtDateFieldFormat::SystemShort);
 m_xEntryFormatter->EnableEmptyField(true);
diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx
index e2be9e2ef8c1..3305e7695dff 100644
--- a/forms/source/component/Date.cxx
+++ b/forms/source/component/Date.cxx
@@ -86,7 +86,7 @@ ODateModel::ODateModel(const Reference& 
_rxFactory)
 try
 {
 if ( m_xAggregateSet.is() )
-m_xAggregateSet->setPropertyValue( PROPERTY_DATEMIN, 
Any(util::Date(1, 1, 0001)) );
+m_xAggregateSet->setPropertyValue( PROPERTY_DATEMIN, 
Any(util::Date(1, 1, 1800)) );
 }
 catch( const Exception& )
 {
diff --git a/toolkit/source/controls/unocontrolmodel.cxx 
b/toolkit/source/controls/unocontrolmodel.cxx
index efd25aa998e7..986f55efbc50 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -226,8 +226,8 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( 
sal_uInt16 nPropId ) const
 case BASEPROPERTY_PUSHBUTTONTYPE:   aDefault <<= sal_Int16(0) 
/*PushButtonType::STANDARD*/; break;
 case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:aDefault <<= 
sal_Int16(awt::MouseWheelBehavior::SCROLL_FOCUS_ONLY); break;
 
-case BASEPROPERTY_DATEMAX:  aDefault <<= util::Date( 
31, 12,  );break;
-case BASEPROPERTY_DATEMIN:  aDefault <<= util::Date( 
1, 1, 0001 );  break;
+case BASEPROPERTY_DATEMAX:  aDefault <<= util::Date( 
31, 12, 2200 );break;
+case BASEPROPERTY_DATEMIN:  aDefault <<= util::Date( 
1, 1, 1900 );  break;
 case BASEPROPERTY_TIMEMAX:  aDefault <<= util::Time(0, 
0, 59, 23, false);  break;
 case BASEPROPERTY_TIMEMIN:  aDefault <<= util::Time(); 
 break;
 case BASEPROPERTY_VALUEMAX_DOUBLE:  aDefault <<= 
double(100);  break;
diff --git a/toolkit/source/controls/unocontrols.cxx 
b/toolkit/source/controls/unocontrols.cxx
index de764e7b8be1..3bc095cf3f03 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -3433,8 +3433,8 @@ 
stardiv_Toolkit_UnoControlDateFieldModel_get_implementation(
 
 UnoDateFieldControl::UnoDateFieldControl()
 {
-mnFirst = util::Date( 1, 1, 0001 );
-mnLast = util::Date( 31, 12,  );
+mnFirst = util::Date( 1, 1, 1900 );
+mnLast = util::Date( 31, 12, 2200 );
 mbLongFormat = TRISTATE_INDET;
 }
 
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx
index 8e916ce984b9..f17aed238ae8 100644
--- a/vcl/source/app/weldutils.cxx
+++ b/vcl/source/app/weldutils.cxx
@@ -444,8 +444,8 @@ void DateFormatter::Init()
 SetOutputHdl(LINK(this, DateFormatter, FormatOutputHdl));
 SetInputHdl(LINK(this, DateFormatter, ParseInputHdl));
 
-SetMin(Date(1, 1, 0001));
-SetMax(Date(31, 12, ));
+SetMin(Date(1, 1, 1900));
+SetMax(Date(31, 12, 2200));
 }
 
 void DateFormatter::SetExtDateFormat(ExtDateFieldFormat eFormat)
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 6af391a6cede..89efabf08c3f 100644
--- a/vcl/source/control/field2.cxx
+++ 

[Libreoffice-commits] core.git: extensions/source forms/source toolkit/source vcl/source

2022-09-07 Thread jucasaca (via logerrit)
 extensions/source/propctrlr/standardcontrol.cxx |4 ++--
 forms/source/component/Date.cxx |2 +-
 toolkit/source/controls/unocontrolmodel.cxx |4 ++--
 toolkit/source/controls/unocontrols.cxx |4 ++--
 vcl/source/app/weldutils.cxx|4 ++--
 vcl/source/control/field2.cxx   |4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit b20594f2fc8f6f9fdbf0b257b4e74d95a8d90139
Author: jucasaca 
AuthorDate: Thu Aug 25 20:21:24 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 7 12:48:16 2022 +0200

tdf#150569 Modify hardcoded dates to extend the range of accepted dates

Replaces date range limits to allow entry of dates between 1/1/0001 and
31/12/, which is the normal date range in most database manager

May need some discussion

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

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index 95b4143c76b8..1c88f98ecf8c 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -99,8 +99,8 @@ namespace pcr
 m_xEntryFormatter.reset(new weld::DateFormatter(*m_xEntry));
 
 m_xEntryFormatter->SetStrictFormat(true);
-m_xEntryFormatter->SetMin(::Date(1, 1, 1600));
-m_xEntryFormatter->SetMax(::Date(1, 1, ));
+m_xEntryFormatter->SetMin(::Date(1, 1, 0001));
+m_xEntryFormatter->SetMax(::Date(31, 12, ));
 
 
m_xEntryFormatter->SetExtDateFormat(ExtDateFieldFormat::SystemShort);
 m_xEntryFormatter->EnableEmptyField(true);
diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx
index 3305e7695dff..e2be9e2ef8c1 100644
--- a/forms/source/component/Date.cxx
+++ b/forms/source/component/Date.cxx
@@ -86,7 +86,7 @@ ODateModel::ODateModel(const Reference& 
_rxFactory)
 try
 {
 if ( m_xAggregateSet.is() )
-m_xAggregateSet->setPropertyValue( PROPERTY_DATEMIN, 
Any(util::Date(1, 1, 1800)) );
+m_xAggregateSet->setPropertyValue( PROPERTY_DATEMIN, 
Any(util::Date(1, 1, 0001)) );
 }
 catch( const Exception& )
 {
diff --git a/toolkit/source/controls/unocontrolmodel.cxx 
b/toolkit/source/controls/unocontrolmodel.cxx
index 986f55efbc50..efd25aa998e7 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -226,8 +226,8 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( 
sal_uInt16 nPropId ) const
 case BASEPROPERTY_PUSHBUTTONTYPE:   aDefault <<= sal_Int16(0) 
/*PushButtonType::STANDARD*/; break;
 case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:aDefault <<= 
sal_Int16(awt::MouseWheelBehavior::SCROLL_FOCUS_ONLY); break;
 
-case BASEPROPERTY_DATEMAX:  aDefault <<= util::Date( 
31, 12, 2200 );break;
-case BASEPROPERTY_DATEMIN:  aDefault <<= util::Date( 
1, 1, 1900 );  break;
+case BASEPROPERTY_DATEMAX:  aDefault <<= util::Date( 
31, 12,  );break;
+case BASEPROPERTY_DATEMIN:  aDefault <<= util::Date( 
1, 1, 0001 );  break;
 case BASEPROPERTY_TIMEMAX:  aDefault <<= util::Time(0, 
0, 59, 23, false);  break;
 case BASEPROPERTY_TIMEMIN:  aDefault <<= util::Time(); 
 break;
 case BASEPROPERTY_VALUEMAX_DOUBLE:  aDefault <<= 
double(100);  break;
diff --git a/toolkit/source/controls/unocontrols.cxx 
b/toolkit/source/controls/unocontrols.cxx
index 3bc095cf3f03..de764e7b8be1 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -3433,8 +3433,8 @@ 
stardiv_Toolkit_UnoControlDateFieldModel_get_implementation(
 
 UnoDateFieldControl::UnoDateFieldControl()
 {
-mnFirst = util::Date( 1, 1, 1900 );
-mnLast = util::Date( 31, 12, 2200 );
+mnFirst = util::Date( 1, 1, 0001 );
+mnLast = util::Date( 31, 12,  );
 mbLongFormat = TRISTATE_INDET;
 }
 
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx
index f17aed238ae8..8e916ce984b9 100644
--- a/vcl/source/app/weldutils.cxx
+++ b/vcl/source/app/weldutils.cxx
@@ -444,8 +444,8 @@ void DateFormatter::Init()
 SetOutputHdl(LINK(this, DateFormatter, FormatOutputHdl));
 SetInputHdl(LINK(this, DateFormatter, ParseInputHdl));
 
-SetMin(Date(1, 1, 1900));
-SetMax(Date(31, 12, 2200));
+SetMin(Date(1, 1, 0001));
+SetMax(Date(31, 12, ));
 }
 
 void DateFormatter::SetExtDateFormat(ExtDateFieldFormat eFormat)
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 89efabf08c3f..6af391a6cede 100644
--- a/vcl/source/control/field2.cxx
+++ 

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

2022-08-31 Thread Noel Grandin (via logerrit)
 extensions/source/propctrlr/propcontroller.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dbc655a1e6bdb118e09d87d1fd9022c201d7b068
Author: Noel Grandin 
AuthorDate: Wed Aug 31 10:57:39 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 31 18:21:56 2022 +0200

cid#1509230 Inefficient vector resizing with reserve.

preserve the benefits of reserving with the benefits of logarithmic
doubling

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

diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index 624bf03d16b6..b0516fd90903 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -956,7 +956,7 @@ namespace pcr
 }
 
 // append these properties to our "all properties" array
-aProperties.reserve( aProperties.size() + 
aThisHandlersProperties.size() );
+aProperties.reserve( std::max(aProperties.size() + 
aThisHandlersProperties.size(), aProperties.size() * 2) );
 for (const auto & aThisHandlersProperty : 
aThisHandlersProperties)
 {
 auto noPrevious = std::none_of(


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

2022-08-26 Thread PoonamShokeen (via logerrit)
 extensions/source/activex/SODispatchInterceptor.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 08a63a88543b0da68380090b655e777bd2b980be
Author: PoonamShokeen 
AuthorDate: Wed Jul 27 12:24:51 2022 -0500
Commit: Hossein 
CommitDate: Fri Aug 26 22:37:43 2022 +0200

tdf#145538 Use range based for loops

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

diff --git a/extensions/source/activex/SODispatchInterceptor.cxx 
b/extensions/source/activex/SODispatchInterceptor.cxx
index adffa93fa64c..14c42a774393 100644
--- a/extensions/source/activex/SODispatchInterceptor.cxx
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -46,9 +46,9 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
SODispatchInterceptor::InterfaceSupportsErrorI
 _ISODispatchInterceptor,
 };
 
-for (std::size_t i=0;i

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

2022-08-23 Thread Mike Kaganski (via logerrit)
 extensions/source/activex/SOActionsApproval.cxx |4 
 extensions/source/activex/SOComWindowPeer.cxx   |4 
 extensions/source/activex/SODispatchInterceptor.cxx |4 
 3 files changed, 12 deletions(-)

New commits:
commit c06e4fffd5b1148ba4fad59866ff9efd20e5e3e8
Author: Mike Kaganski 
AuthorDate: Tue Aug 23 09:48:31 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Aug 23 09:45:45 2022 +0200

Drop obsolete code

Clang also defines _MSC_VER macro.

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

diff --git a/extensions/source/activex/SOActionsApproval.cxx 
b/extensions/source/activex/SOActionsApproval.cxx
index a4092166272b..3ea4ac8dcf33 100644
--- a/extensions/source/activex/SOActionsApproval.cxx
+++ b/extensions/source/activex/SOActionsApproval.cxx
@@ -45,11 +45,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
SOActionsApproval::InterfaceSupportsErrorInfo(
 
 for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
 {
-#ifdef _MSC_VER
 if (InlineIsEqualGUID(*arr[i], riid))
-#else
-if (::ATL::InlineIsEqualGUID(*arr[i], riid))
-#endif
 return S_OK;
 }
 return S_FALSE;
diff --git a/extensions/source/activex/SOComWindowPeer.cxx 
b/extensions/source/activex/SOComWindowPeer.cxx
index 0a556466d32f..dbd2bcc3e662 100644
--- a/extensions/source/activex/SOComWindowPeer.cxx
+++ b/extensions/source/activex/SOComWindowPeer.cxx
@@ -44,11 +44,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
SOComWindowPeer::InterfaceSupportsErrorInfo(RE
 
 for (std::size_t i = 0; i < SAL_N_ELEMENTS(arr); i++)
 {
-#ifdef _MSC_VER
 if (InlineIsEqualGUID(*arr[i], riid))
-#else
-if (::ATL::InlineIsEqualGUID(*arr[i], riid))
-#endif
 return S_OK;
 }
 return S_FALSE;
diff --git a/extensions/source/activex/SODispatchInterceptor.cxx 
b/extensions/source/activex/SODispatchInterceptor.cxx
index f40f6263512d..adffa93fa64c 100644
--- a/extensions/source/activex/SODispatchInterceptor.cxx
+++ b/extensions/source/activex/SODispatchInterceptor.cxx
@@ -48,11 +48,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
SODispatchInterceptor::InterfaceSupportsErrorI
 
 for (std::size_t i=0;i

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

2022-08-19 Thread Liu Hao (via logerrit)
 extensions/source/scanner/grid.cxx   |2 
 sal/qa/rtl/math/test-rtl-math.cxx|   58 +++
 sc/source/core/tool/interpr2.cxx |   14 ++---
 sc/source/core/tool/interpr3.cxx |   20 +++
 sc/source/ui/dataprovider/datatransformation.cxx |2 
 5 files changed, 48 insertions(+), 48 deletions(-)

New commits:
commit 466f86abb7208e853ad48ae46e97a2455667fa42
Author: Liu Hao 
AuthorDate: Mon Aug 15 18:07:07 2022 +0800
Commit: Eike Rathke 
CommitDate: Fri Aug 19 17:23:59 2022 +0200

tdf#148430 Use std math functions instead of rtl::math

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

diff --git a/extensions/source/scanner/grid.cxx 
b/extensions/source/scanner/grid.cxx
index 110779c55080..c727c8c92a5a 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -648,7 +648,7 @@ void GridWindow::ChangeMode(ResetType nType)
 {
 for( int i = 0; i < m_nValues; i++ )
 {
-m_pNewYValues[ i ] = m_fMinY + 
(m_fMaxY-m_fMinY)*(rtl::math::expm1((m_pXValues[i]-m_fMinX)/(m_fMaxX-m_fMinX)))/(M_E-1.0);
+m_pNewYValues[ i ] = m_fMinY + 
(m_fMaxY-m_fMinY)*(std::expm1((m_pXValues[i]-m_fMinX)/(m_fMaxX-m_fMinX)))/(M_E-1.0);
 }
 }
 break;
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx 
b/sal/qa/rtl/math/test-rtl-math.cxx
index ee4ae55a1a4b..69a54bd814ef 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -505,84 +505,84 @@ public:
 void test_erf() {
 double x, res;
 x =  0.0;
-res = rtl::math::erf(x);
+res = std::erf(x);
 CPPUNIT_ASSERT_EQUAL(0.0,res);
 rtl::math::setInf( , false);
-res = rtl::math::erf(x);
+res = std::erf(x);
 CPPUNIT_ASSERT_EQUAL(1.0,res);
 rtl::math::setInf( , true);
-res = rtl::math::erf(x);
+res = std::erf(x);
 CPPUNIT_ASSERT_EQUAL(-1.0,res);
 rtl::math::setNan( );
-res = rtl::math::erf(x);
+res = std::erf(x);
 CPPUNIT_ASSERT(std::isnan(res));
 x = 3.0;
-res = rtl::math::erf(-x);
-CPPUNIT_ASSERT_DOUBLES_EQUAL( -rtl::math::erf(x), res, 1E-12);
+res = std::erf(-x);
+CPPUNIT_ASSERT_DOUBLES_EQUAL( -std::erf(x), res, 1E-12);
 }
 
 void test_erfc() {
 double x, res;
 x =  0.0;
-res = rtl::math::erfc(x);
+res = std::erfc(x);
 CPPUNIT_ASSERT_EQUAL(1.0,res);
 rtl::math::setInf( , false);
-res = rtl::math::erfc(x);
+res = std::erfc(x);
 CPPUNIT_ASSERT_EQUAL(0.0,res);
 rtl::math::setInf( , true);
-res = rtl::math::erfc(x);
+res = std::erfc(x);
 CPPUNIT_ASSERT_EQUAL(2.0,res);
 rtl::math::setNan( );
-res = rtl::math::erfc(x);
+res = std::erfc(x);
 CPPUNIT_ASSERT(std::isnan(res));
 x = 3.0;
-res = rtl::math::erfc(-x);
-CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 - rtl::math::erfc(x), res, 1E-12);
+res = std::erfc(-x);
+CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 - std::erfc(x), res, 1E-12);
 }
 
 void test_expm1() {
 double x, res;
 x =  0.0;
-res = rtl::math::expm1(x);
+res = std::expm1(x);
 CPPUNIT_ASSERT_EQUAL(0.0,res);
 x = -0.0;
-res = rtl::math::expm1(x);
+res = std::expm1(x);
 CPPUNIT_ASSERT_EQUAL(-0.0,res);
 CPPUNIT_ASSERT(std::signbit(res));
 rtl::math::setInf( , false);
-res = rtl::math::expm1(x);
+res = std::expm1(x);
 CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !std::signbit(res));
 rtl::math::setInf( , true);
-res = rtl::math::expm1(x);
+res = std::expm1(x);
 CPPUNIT_ASSERT_EQUAL(-1.0,res);
 rtl::math::setNan( );
-res = rtl::math::expm1(x);
+res = std::expm1(x);
 CPPUNIT_ASSERT(std::isnan(res));
 }
 
 void test_log1p() {
 double x, res;
 x =  0.0;
-res = rtl::math::log1p(x);
+res = std::log1p(x);
 CPPUNIT_ASSERT_EQUAL(0.0,res);
 x = -0.0;
-res = rtl::math::log1p(x);
+res = std::log1p(x);
 CPPUNIT_ASSERT_EQUAL(-0.0,res);
 CPPUNIT_ASSERT(std::signbit(res));
 rtl::math::setInf( , false);
-res = rtl::math::log1p(x);
+res = std::log1p(x);
 CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !std::signbit(res));
 x = -1.0;
-res = rtl::math::log1p(x);
+res = std::log1p(x);
 CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && std::signbit(res));
 x = -1.1;
-res = rtl::math::log1p(x);
+res = std::log1p(x);
 CPPUNIT_ASSERT(std::isnan(res));
 

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

2022-08-09 Thread Justin Luth (via logerrit)
 extensions/source/propctrlr/browserview.cxx|4 ++--
 extensions/source/propctrlr/browserview.hxx|2 +-
 extensions/source/propctrlr/propertyeditor.cxx |4 ++--
 extensions/source/propctrlr/propertyeditor.hxx |4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit a8ae24a8bd7bfffa75af9d0dc50765d51df9c720
Author: Justin Luth 
AuthorDate: Mon Aug 8 14:43:10 2022 -0400
Commit: Caolán McNamara 
CommitDate: Tue Aug 9 11:38:00 2022 +0200

tdf#150278: avoid gen/gtk3 difference in m_xPropBox->GetCurPage()

When switching between tabs, at this call SAL_USE_VCLPLUGIN=gen
was returning the switched-to-tab id, while gtk3 was still
returning the leaving-tab's id.

So just ignore all that an use the OnActivatePage value.

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

diff --git a/extensions/source/propctrlr/browserview.cxx 
b/extensions/source/propctrlr/browserview.cxx
index df0c6693b9bd..e7b7cb690d20 100644
--- a/extensions/source/propctrlr/browserview.cxx
+++ b/extensions/source/propctrlr/browserview.cxx
@@ -35,9 +35,9 @@ namespace pcr
 m_xPropBox->setPageActivationHandler(LINK(this, OPropertyBrowserView, 
OnPageActivation));
 }
 
-IMPL_LINK_NOARG(OPropertyBrowserView, OnPageActivation, LinkParamNone*, 
void)
+IMPL_LINK(OPropertyBrowserView, OnPageActivation, const OString&, 
rNewPage, void)
 {
-m_nActivePage = m_xPropBox->GetCurPage();
+m_nActivePage = rNewPage.toUInt32();
 m_aPageActivationHandler.Call(nullptr);
 }
 
diff --git a/extensions/source/propctrlr/browserview.hxx 
b/extensions/source/propctrlr/browserview.hxx
index 35195d20e199..7a0711fb145c 100644
--- a/extensions/source/propctrlr/browserview.hxx
+++ b/extensions/source/propctrlr/browserview.hxx
@@ -48,7 +48,7 @@ namespace pcr
 css::awt::Size getMinimumSize() const;
 
 private:
-DECL_LINK(OnPageActivation, LinkParamNone*, void);
+DECL_LINK(OnPageActivation, const OString&, void);
 };
 
 } // namespace pcr
diff --git a/extensions/source/propctrlr/propertyeditor.cxx 
b/extensions/source/propctrlr/propertyeditor.cxx
index e412508f3aa7..45d2fb2bc7ce 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -347,9 +347,9 @@ namespace pcr
 return xControl;
 }
 
-IMPL_LINK_NOARG(OPropertyEditor, OnPageActivate, const OString&, void)
+IMPL_LINK(OPropertyEditor, OnPageActivate, const OString&, rNewPage, void)
 {
-m_aPageActivationHandler.Call(nullptr);
+m_aPageActivationHandler.Call(rNewPage);
 }
 
 IMPL_LINK(OPropertyEditor, OnPageDeactivate, const OString&, rIdent, bool)
diff --git a/extensions/source/propctrlr/propertyeditor.hxx 
b/extensions/source/propctrlr/propertyeditor.hxx
index 606da6561705..fa0e3a0cd3ab 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -57,7 +57,7 @@ namespace pcr
 IPropertyLineListener*  m_pListener;
 IPropertyControlObserver*   m_pObserver;
 sal_uInt16  m_nNextId;
-Link   m_aPageActivationHandler;
+Link   m_aPageActivationHandler;
 boolm_bHasHelpSection;
 
 MapStringToPageId   m_aPropertyPageIds;
@@ -95,7 +95,7 @@ namespace pcr
 voidRemoveEntry( const OUString& _rName );
 voidChangeEntry( const OLineDescriptor& );
 
-voidsetPageActivationHandler(const 
Link& _rHdl) { m_aPageActivationHandler = _rHdl; }
+voidsetPageActivationHandler(const Link& _rHdl) { m_aPageActivationHandler = _rHdl; }
 
 Sizeget_preferred_size() const;
 


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

2022-06-21 Thread Noel Grandin (via logerrit)
 extensions/source/abpilot/admininvokationimpl.cxx|5 +--
 extensions/source/abpilot/admininvokationimpl.hxx|2 -
 extensions/source/bibliography/framectr.cxx  |5 +--
 extensions/source/bibliography/framectr.hxx  |9 +++--
 extensions/source/bibliography/general.cxx   |5 +--
 extensions/source/bibliography/toolbar.cxx   |5 +--
 extensions/source/bibliography/toolbar.hxx   |2 -
 extensions/source/dbpilots/unoautopilot.hxx  |3 +
 extensions/source/logging/logger.cxx |7 ++--
 extensions/source/propctrlr/browserline.cxx  |5 +--
 extensions/source/propctrlr/browserline.hxx  |2 -
 extensions/source/propctrlr/browserlistbox.hxx   |9 +++--
 extensions/source/propctrlr/cellbindinghelper.cxx|3 +
 extensions/source/propctrlr/eventhandler.cxx |7 ++--
 extensions/source/propctrlr/eventhandler.hxx |4 +-
 extensions/source/propctrlr/formbrowsertools.hxx |3 +
 extensions/source/propctrlr/formcontroller.cxx   |5 +--
 extensions/source/propctrlr/formcontroller.hxx   |2 -
 extensions/source/propctrlr/formgeometryhandler.cxx  |7 ++--
 extensions/source/propctrlr/formlinkdialog.cxx   |9 +++--
 extensions/source/propctrlr/formlinkdialog.hxx   |4 +-
 extensions/source/propctrlr/formmetadata.cxx |   17 +--
 extensions/source/propctrlr/listselectiondlg.cxx |5 +--
 extensions/source/propctrlr/listselectiondlg.hxx |2 -
 extensions/source/propctrlr/propertycomposer.cxx |3 +
 extensions/source/propctrlr/propertyeditor.cxx   |5 +--
 extensions/source/propctrlr/propertyeditor.hxx   |2 -
 extensions/source/propctrlr/sqlcommanddesign.cxx |5 +--
 extensions/source/propctrlr/sqlcommanddesign.hxx |2 -
 extensions/source/propctrlr/stringrepresentation.cxx |7 ++--
 extensions/source/scanner/scanunx.cxx|7 ++--
 extensions/source/update/feed/updatefeed.cxx |   29 +--
 32 files changed, 105 insertions(+), 82 deletions(-)

New commits:
commit c7c49309d0021b0e26c3179dd7adce71431ec7fc
Author: Noel Grandin 
AuthorDate: Tue Jun 21 09:01:08 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 21 13:17:18 2022 +0200

clang-tidy modernize-pass-by-value in extensions

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

diff --git a/extensions/source/abpilot/admininvokationimpl.cxx 
b/extensions/source/abpilot/admininvokationimpl.cxx
index c8ec00b681a7..b2e26ed35af1 100644
--- a/extensions/source/abpilot/admininvokationimpl.cxx
+++ b/extensions/source/abpilot/admininvokationimpl.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -41,10 +42,10 @@ namespace abp
 using namespace ::com::sun::star::sdbc;
 
 OAdminDialogInvokation::OAdminDialogInvokation(const Reference< 
XComponentContext >& _rxContext,
-const css::uno::Reference< css::beans::XPropertySet >& 
_rxDataSource,
+css::uno::Reference< css::beans::XPropertySet > 
_xDataSource,
 weld::Window* _pMessageParent)
 :m_xContext(_rxContext)
-,m_xDataSource(_rxDataSource)
+,m_xDataSource(std::move(_xDataSource))
 ,m_pMessageParent(_pMessageParent)
 {
 DBG_ASSERT(m_xContext.is(), 
"OAdminDialogInvokation::OAdminDialogInvokation: invalid service factory!");
diff --git a/extensions/source/abpilot/admininvokationimpl.hxx 
b/extensions/source/abpilot/admininvokationimpl.hxx
index 2003809c8727..fef7a11eb388 100644
--- a/extensions/source/abpilot/admininvokationimpl.hxx
+++ b/extensions/source/abpilot/admininvokationimpl.hxx
@@ -40,7 +40,7 @@ namespace abp
 public:
 OAdminDialogInvokation(
 const css::uno::Reference< css::uno::XComponentContext >& 
_rxContext,
-const css::uno::Reference< css::beans::XPropertySet >& 
_rDataSource,
+css::uno::Reference< css::beans::XPropertySet > _xDataSource,
 weld::Window* _pMessageParent
 );
 
diff --git a/extensions/source/bibliography/framectr.cxx 
b/extensions/source/bibliography/framectr.cxx
index a273635d91cb..f4aa45a708ed 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -25,6 +25,7 @@
 #include 
 #include "bibconfig.hxx"
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -146,9 +147,9 @@ void BibFrameCtrl_Impl::disposing( const lang::EventObject& 
/*Source*/ )
 pController->getFrame()->removeFrameActionListener( this );
 }
 
-BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< 
awt::XWindow > & xComponent,
+BibFrameController_Impl::BibFrameController_Impl( uno::Reference< awt::XWindow 
> xComponent,
 

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

2022-06-20 Thread jsala (via logerrit)
 extensions/source/propctrlr/formmetadata.cxx |   69 +--
 extensions/source/propctrlr/formmetadata.hxx |2 
 2 files changed, 35 insertions(+), 36 deletions(-)

New commits:
commit 2c68c419c1fce6de1a81e1f13a84b7069125a204
Author: jsala 
AuthorDate: Sun Jun 19 16:46:44 2022 +0200
Commit: Hossein 
CommitDate: Mon Jun 20 12:25:56 2022 +0200

tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro

Also change some integer by std::size_t

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

diff --git a/extensions/source/propctrlr/formmetadata.cxx 
b/extensions/source/propctrlr/formmetadata.cxx
index 13a7b32e706b..eff907f49b47 100644
--- a/extensions/source/propctrlr/formmetadata.cxx
+++ b/extensions/source/propctrlr/formmetadata.cxx
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 namespace pcr
@@ -98,7 +97,7 @@ namespace pcr
 #define DEF_INFO_4( ident, uinameres, pos, helpid, flag1, flag2, flag3, flag4 
) \
 DEF_INFO( ident, uinameres, pos, helpid, PROP_FLAG_##flag1 | 
PROP_FLAG_##flag2 | PROP_FLAG_##flag3 | PROP_FLAG_##flag4 )
 
-sal_uInt16  OPropertyInfoService::s_nCount = 0;
+std::size_t OPropertyInfoService::s_nCount = 0;
 OPropertyInfoImpl*  OPropertyInfoService::s_pPropertyInfos = nullptr;
 
 const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo()
@@ -359,7 +358,7 @@ namespace pcr
 };
 
 s_pPropertyInfos = aPropertyInfos;
-s_nCount = SAL_N_ELEMENTS(aPropertyInfos);
+s_nCount = std::size(aPropertyInfos);
 
 // sort
 std::sort( s_pPropertyInfos, s_pPropertyInfos + s_nCount, 
PropertyInfoLessByName() );
@@ -416,126 +415,126 @@ namespace pcr
 return { "Get", "Post" };
 }
 const TranslateId* pStringItemsResId = nullptr;
-int nElements = 0;
+std::size_t nElements = 0;
 switch ( _nId )
 {
 case PROPERTY_ID_IMAGEPOSITION:
 pStringItemsResId = RID_RSC_ENUM_IMAGE_POSITION;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_IMAGE_POSITION);
+nElements = std::size(RID_RSC_ENUM_IMAGE_POSITION);
 break;
 case PROPERTY_ID_BORDER:
 pStringItemsResId = RID_RSC_ENUM_BORDER_TYPE;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_BORDER_TYPE);
+nElements = std::size(RID_RSC_ENUM_BORDER_TYPE);
 break;
 case PROPERTY_ID_ICONSIZE:
 pStringItemsResId = RID_RSC_ENUM_ICONSIZE_TYPE;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_ICONSIZE_TYPE);
+nElements = std::size(RID_RSC_ENUM_ICONSIZE_TYPE);
 break;
 case PROPERTY_ID_COMMANDTYPE:
 pStringItemsResId = RID_RSC_ENUM_COMMAND_TYPE;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_COMMAND_TYPE);
+nElements = std::size(RID_RSC_ENUM_COMMAND_TYPE);
 break;
 case PROPERTY_ID_LISTSOURCETYPE:
 pStringItemsResId = RID_RSC_ENUM_LISTSOURCE_TYPE;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_LISTSOURCE_TYPE);
+nElements = std::size(RID_RSC_ENUM_LISTSOURCE_TYPE);
 break;
 case PROPERTY_ID_ALIGN:
 pStringItemsResId = RID_RSC_ENUM_ALIGNMENT;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_ALIGNMENT);
+nElements = std::size(RID_RSC_ENUM_ALIGNMENT);
 break;
 case PROPERTY_ID_VERTICAL_ALIGN:
 pStringItemsResId = RID_RSC_ENUM_VERTICAL_ALIGN;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_VERTICAL_ALIGN);
+nElements = std::size(RID_RSC_ENUM_VERTICAL_ALIGN);
 break;
 case PROPERTY_ID_BUTTONTYPE:
 pStringItemsResId = RID_RSC_ENUM_BUTTONTYPE;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_BUTTONTYPE);
+nElements = std::size(RID_RSC_ENUM_BUTTONTYPE);
 break;
 case PROPERTY_ID_PUSHBUTTONTYPE:
 pStringItemsResId = RID_RSC_ENUM_PUSHBUTTONTYPE;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_PUSHBUTTONTYPE);
+nElements = std::size(RID_RSC_ENUM_PUSHBUTTONTYPE);
 break;
 case PROPERTY_ID_SUBMIT_ENCODING:
 pStringItemsResId = RID_RSC_ENUM_SUBMIT_ENCODING;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_SUBMIT_ENCODING);
+nElements = std::size(RID_RSC_ENUM_SUBMIT_ENCODING);
 break;
 case PROPERTY_ID_DATEFORMAT:
 pStringItemsResId = RID_RSC_ENUM_DATEFORMAT_LIST;
-nElements = SAL_N_ELEMENTS(RID_RSC_ENUM_DATEFORMAT_LIST);
+

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

2022-05-04 Thread Stephan Bergmann (via logerrit)
 extensions/source/abpilot/datasourcehandling.cxx |   14 ++---
 extensions/source/abpilot/fieldmappingimpl.cxx   |   14 ++---
 extensions/source/abpilot/unodialogabp.cxx   |6 +-
 extensions/source/bibliography/datman.cxx|   22 
 extensions/source/bibliography/general.cxx   |4 -
 extensions/source/config/WinUserInfo/WinUserInfoBe.cxx   |4 -
 extensions/source/dbpilots/commonpagesdbp.cxx|6 +-
 extensions/source/dbpilots/controlwizard.cxx |8 +-
 extensions/source/dbpilots/gridwizard.cxx|8 +-
 extensions/source/dbpilots/listcombowizard.cxx   |   10 +--
 extensions/source/dbpilots/optiongrouplayouter.cxx   |   16 ++---
 extensions/source/logging/loggerconfig.cxx   |5 -
 extensions/source/ole/unoconversionutilities.hxx |2 
 extensions/source/propctrlr/cellbindinghandler.cxx   |6 +-
 extensions/source/propctrlr/cellbindinghelper.cxx|   14 ++---
 extensions/source/propctrlr/editpropertyhandler.cxx  |8 +-
 extensions/source/propctrlr/eformshelper.cxx |8 +-
 extensions/source/propctrlr/eformspropertyhandler.cxx|   10 +--
 extensions/source/propctrlr/eventhandler.cxx |   13 ++--
 extensions/source/propctrlr/fontdialog.cxx   |   24 
 extensions/source/propctrlr/formcomponenthandler.cxx |   20 +++
 extensions/source/propctrlr/formgeometryhandler.cxx  |   13 ++--
 extensions/source/propctrlr/formlinkdialog.cxx   |4 -
 extensions/source/propctrlr/genericpropertyhandler.cxx   |2 
 extensions/source/propctrlr/handlerhelper.cxx|2 
 extensions/source/propctrlr/inspectormodelbase.cxx   |3 -
 extensions/source/propctrlr/listselectiondlg.cxx |2 
 extensions/source/propctrlr/pcrunodialogs.cxx|6 +-
 extensions/source/propctrlr/propcontroller.cxx   |2 
 extensions/source/propctrlr/propertyhandler.cxx  |2 
 extensions/source/propctrlr/pushbuttonnavigation.cxx |4 -
 extensions/source/propctrlr/selectlabeldialog.cxx|2 
 extensions/source/propctrlr/standardcontrol.cxx  |4 -
 extensions/source/propctrlr/stringrepresentation.cxx |2 
 extensions/source/propctrlr/xsdvalidationhelper.cxx  |6 +-
 extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx |6 +-
 extensions/source/update/check/updatecheck.cxx   |   14 ++---
 extensions/source/update/check/updatecheckconfig.cxx |   30 +--
 extensions/source/update/check/updatehdl.cxx |   20 +++
 extensions/source/update/feed/updatefeed.cxx |6 +-
 40 files changed, 174 insertions(+), 178 deletions(-)

New commits:
commit 5e4134535391e9977e72c7001e3b4a5eea113c3c
Author: Stephan Bergmann 
AuthorDate: Wed May 4 12:01:16 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 19:27:44 2022 +0200

Just use Any ctor instead of makeAny in extensions

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

diff --git a/extensions/source/abpilot/datasourcehandling.cxx 
b/extensions/source/abpilot/datasourcehandling.cxx
index 806acca41f16..a411c2536b50 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -141,7 +141,7 @@ namespace abp
 {
 xNewDataSource->setPropertyValue(
 "URL",
-makeAny( OUString::createFromAscii( _pInitialAsciiURL ) )
+Any( OUString::createFromAscii( _pInitialAsciiURL ) )
 );
 }
 
@@ -360,9 +360,9 @@ namespace abp
 uno::Reference xStorage = 
pObjectShell->GetStorage();
 uno::Sequence aSequence = 
comphelper::InitPropertySequence(
 {
-{"TargetStorage", uno::makeAny(xStorage)},
-{"StreamRelPath", uno::makeAny(aStreamRelPath)},
-{"BaseURI", uno::makeAny(aOwnURL)}
+{"TargetStorage", uno::Any(xStorage)},
+{"StreamRelPath", uno::Any(aStreamRelPath)},
+{"BaseURI", uno::Any(aOwnURL)}
 });
 xStorable->storeAsURL(sTmpName, aSequence);
 m_pImpl->sName = sTmpName;
@@ -371,7 +371,7 @@ namespace abp
 // we can load it again next time the file is imported.
 uno::Reference 
xFactory(pObjectShell->GetModel(), uno::UNO_QUERY);
 uno::Reference 

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

2022-04-19 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/updatehdl.cxx |   13 -
 extensions/source/update/check/updatehdl.hxx |2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit b12727e15a82216f709ccb6e37a9029d60ad4831
Author: Stephan Bergmann 
AuthorDate: Tue Apr 19 09:40:53 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 19 11:32:56 2022 +0200

loplugin:stringviewparam

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

diff --git a/extensions/source/update/check/updatehdl.cxx 
b/extensions/source/update/check/updatehdl.cxx
index b0ecb69e37f9..4ccf0f4fcc20 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
 
 #include "updatehdl.hxx"
 #include 
@@ -240,13 +243,13 @@ void UpdateHandler::setErrorMessage( const OUString& 
rErrorMsg )
 }
 
 
-void UpdateHandler::setDownloadFile( const OUString& rFilePath )
+void UpdateHandler::setDownloadFile( std::u16string_view rFilePath )
 {
-sal_Int32 nLast = rFilePath.lastIndexOf( '/' );
-if ( nLast != -1 )
+std::size_t nLast = rFilePath.rfind( '/' );
+if ( nLast != std::u16string_view::npos )
 {
-msDownloadFile = rFilePath.copy( nLast+1 );
-const OUString aDownloadURL = rFilePath.copy( 0, nLast );
+msDownloadFile = rFilePath.substr( nLast+1 );
+const OUString aDownloadURL(rFilePath.substr( 0, nLast ));
 osl::FileBase::getSystemPathFromFileURL( aDownloadURL, msDownloadPath 
);
 }
 }
diff --git a/extensions/source/update/check/updatehdl.hxx 
b/extensions/source/update/check/updatehdl.hxx
index 6597176468bd..297cf730ce4b 100644
--- a/extensions/source/update/check/updatehdl.hxx
+++ b/extensions/source/update/check/updatehdl.hxx
@@ -166,7 +166,7 @@ public:
 voidsetProgress( sal_Int32 nPercent );
 voidsetNextVersion( const OUString  ) { 
msNextVersion = rNextVersion; }
 voidsetDownloadPath( const OUString  ) { 
msDownloadPath = rPath; }
-voidsetDownloadFile( const OUString  );
+voidsetDownloadFile( std::u16string_view rPath );
 voidsetErrorMessage( const OUString  );
 voidsetDescription( const OUString  ){ 
msDescriptionMsg = rDescription; }
 


[Libreoffice-commits] core.git: extensions/source reportdesign/source

2022-03-31 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/formcomponenthandler.cxx  |4 
 reportdesign/source/ui/inspection/DataProviderHandler.cxx |3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 6c0dca63cd93c393b12bdbd2ce777c275a9279ff
Author: Caolán McNamara 
AuthorDate: Wed Mar 30 21:22:16 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Mar 31 11:34:04 2022 +0200

Resolves: tdf#117159 don't crash with chart selected in database report edit

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

diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index 69e418b64e3d..2bf922d1b603 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -243,6 +243,10 @@ namespace pcr
 {
 const PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( 
_rPropertyName ) );
 
+// tdf#117159 crash with chart in database report
+if (!m_xComponent)
+return Any();
+
 Any aPropertyValue( m_xComponent->getPropertyValue( _rPropertyName ) );
 
 Reference< resource::XStringResourceResolver > xStringResourceResolver
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx 
b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index a6c1214704a7..389074a903c5 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -182,7 +182,8 @@ uno::Any SAL_CALL 
DataProviderHandler::getPropertyValue(const OUString & Propert
 //}
 break;
 case PROPERTY_ID_PREVIEW_COUNT:
-aPropertyValue <<= m_xDataProvider->getRowLimit();
+if (m_xDataProvider) // tdf#117159 crash with chart in database 
report otherwise
+aPropertyValue <<= m_xDataProvider->getRowLimit();
 break;
 default:
 aPropertyValue = m_xFormComponentHandler->getPropertyValue( 
PropertyName );


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

2022-03-28 Thread Stephan Bergmann (via logerrit)
 extensions/source/propctrlr/stringrepresentation.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 82e8160c3bebd89527f83bf24c2cfb2aa892611a
Author: Stephan Bergmann 
AuthorDate: Mon Mar 28 16:55:03 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Mar 28 20:06:12 2022 +0200

-Werror,-Wunused-but-set-variable

...since f1702aa8e46d63b85cc16e550c96b79509057c89 "INTEGRATION: CWS oj14".
(Maybe the odd code was there to allow breaking on it with a debugger, and 
the
original author wondered whether TypeClass_CONSTANT can actually happen 
here,
which it probably can not, so it should probably be replaced with
O3TL_UNREACHABLE, but that's left for a follow-up.)

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

diff --git a/extensions/source/propctrlr/stringrepresentation.cxx 
b/extensions/source/propctrlr/stringrepresentation.cxx
index 83befe2039d3..3c984eb0a867 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -416,10 +416,6 @@ bool StringRepresentation::convertGenericValueToString( 
const uno::Any& _rValue,
 }
 break;
 case uno::TypeClass_CONSTANT:
-{
-int i = 0;
-++i;
-}
 break;
 
 // some structs


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

2022-03-11 Thread Noel Grandin (via logerrit)
 extensions/source/propctrlr/formcomponenthandler.cxx |9 --
 sw/source/ui/envelp/envfmt.cxx   |7 --
 sw/source/ui/frmdlg/column.cxx   |5 -
 sw/source/ui/frmdlg/frmpage.cxx  |   46 +
 sw/source/ui/table/tabledlg.cxx  |   65 ---
 5 files changed, 57 insertions(+), 75 deletions(-)

New commits:
commit 7b634028cec2df4136017be483ebc3c32bc8d9ec
Author: Noel Grandin 
AuthorDate: Tue Jan 25 10:44:57 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 11 19:26:45 2022 +0100

use more SfxItemSet::GetItemIfSet

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

diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index 20a21ad8ae72..69e418b64e3d 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2715,18 +2715,15 @@ namespace pcr
 {
 const SfxItemSet* pResult = aDialog.GetOutputItemSet();
 
-const SfxPoolItem* pItem = pResult->GetItem( 
SID_ATTR_NUMBERFORMAT_INFO );
-const SvxNumberInfoItem* pInfoItem = dynamic_cast< const 
SvxNumberInfoItem* >( pItem );
-if (pInfoItem)
+if (const SvxNumberInfoItem* pInfoItem = pResult->GetItem( 
SID_ATTR_NUMBERFORMAT_INFO ))
 {
 for (sal_uInt32 key : pInfoItem->GetDelFormats())
 pFormatter->DeleteEntry(key);
 }
 
-pItem = nullptr;
-if ( SfxItemState::SET == pResult->GetItemState( 
SID_ATTR_NUMBERFORMAT_VALUE, false,  ) )
+if ( const SfxUInt32Item* pItem = pResult->GetItemIfSet( 
SID_ATTR_NUMBERFORMAT_VALUE, false ) )
 {
-_out_rNewValue <<= static_cast( static_cast< 
const SfxUInt32Item* >( pItem )->GetValue() );
+_out_rNewValue <<= static_cast( 
pItem->GetValue() );
 bChanged = true;
 }
 }
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 56c5f9135b71..26cd00923873 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -227,13 +227,12 @@ void SwEnvFormatPage::Edit(std::string_view rIdent, bool 
bSender)
 if (aDlg.run() == RET_OK)
 {
 // maybe relocate defaults
-const SfxPoolItem* pItem = nullptr;
+const SfxUInt16Item* pDefaultsItem = nullptr;
 SfxItemSet* pOutputSet = 
const_cast(aDlg.GetOutputItemSet());
 sal_uInt16 nNewDist;
 
-if( SfxItemState::SET == pOutputSet->GetItemState( 
SID_ATTR_TABSTOP_DEFAULTS,
-false,  ) &&
-nDefDist != (nNewDist = static_cast(pItem)->GetValue()) )
+if( (pDefaultsItem = pOutputSet->GetItemIfSet( 
SID_ATTR_TABSTOP_DEFAULTS, false )) &&
+nDefDist != (nNewDist = pDefaultsItem->GetValue()) )
 {
 SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, 
RES_PARATR_TABSTOP );
 MakeDefTabs( nNewDist, aDefTabs );
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index f12ae77f4180..e03eb2945999 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -562,9 +562,8 @@ void SwColumnPage::Reset(const SfxItemSet *rSet)
 }
 if (m_xBalanceColsCB->get_visible())
 {
-const SfxPoolItem* pItem;
-if( SfxItemState::SET == rSet->GetItemState( RES_COLUMNBALANCE, false, 
 ))
-m_xBalanceColsCB->set_active(!static_cast(pItem)->GetValue());
+if( const SwFormatNoBalancedColumns* pItem = rSet->GetItemIfSet( 
RES_COLUMNBALANCE, false ) )
+m_xBalanceColsCB->set_active(!pItem->GetValue());
 else
 m_xBalanceColsCB->set_active(true);
 }
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 66837f87fe43..a48a939dfbeb 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -870,13 +870,12 @@ void SwFramePage::Reset( const SfxItemSet *rSet )
 ::SetFieldUnit(*m_xAtHorzPosED, aMetric);
 ::SetFieldUnit(*m_xAtVertPosED, aMetric);
 
-const SfxPoolItem* pItem = nullptr;
 const SwFormatAnchor& rAnchor = rSet->Get(RES_ANCHOR);
 
-if (SfxItemState::SET == rSet->GetItemState(FN_OLE_IS_MATH, false, ))
-m_bIsMathOLE = static_cast(pItem)->GetValue();
-if (SfxItemState::SET == rSet->GetItemState(FN_MATH_BASELINE_ALIGNMENT, 
false, ))
-m_bIsMathBaselineAlignment = static_cast(pItem)->GetValue();
+if (const SfxBoolItem* pMathItem = rSet->GetItemIfSet(FN_OLE_IS_MATH, 
false))
+m_bIsMathOLE = 

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

2022-03-11 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/updatecheckconfig.cxx |4 
 extensions/source/update/check/updatecheckconfig.hxx |2 --
 2 files changed, 6 deletions(-)

New commits:
commit d680b29e05dd3ac2e64e47c4e1f83a4e38b1db24
Author: Stephan Bergmann 
AuthorDate: Fri Mar 11 10:55:38 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 11 13:01:31 2022 +0100

loplugin:trivialdestructor

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

diff --git a/extensions/source/update/check/updatecheckconfig.cxx 
b/extensions/source/update/check/updatecheckconfig.cxx
index 30e444051e3f..6a9236ed6987 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -75,10 +75,6 @@ const char * const aUpdateEntryProperties[] = {
 
 const sal_uInt32 nUpdateEntryProperties = 
SAL_N_ELEMENTS(aUpdateEntryProperties);
 
-NamedValueByNameAccess::~NamedValueByNameAccess()
-{
-}
-
 css::uno::Any NamedValueByNameAccess::getValue(const char * pName)
 {
 const sal_Int32 nLen = m_rValues.getLength();
diff --git a/extensions/source/update/check/updatecheckconfig.hxx 
b/extensions/source/update/check/updatecheckconfig.hxx
index 75e65e6e8be0..a9836c624822 100644
--- a/extensions/source/update/check/updatecheckconfig.hxx
+++ b/extensions/source/update/check/updatecheckconfig.hxx
@@ -40,8 +40,6 @@ public:
 const css::uno::Sequence< css::beans::NamedValue >& rValues) :
 m_rValues(rValues) {} ;
 
-~NamedValueByNameAccess();
-
 css::uno::Any getValue(const char * pName);
 };
 


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

2022-01-15 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/handlerhelper.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit dd497f18e5a5aaa5d1116e87b12ea23d619088e2
Author: Caolán McNamara 
AuthorDate: Sat Jan 15 16:35:33 2022 +
Commit: Caolán McNamara 
CommitDate: Sat Jan 15 20:43:45 2022 +0100

include memory for std::unique_ptr

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

diff --git a/extensions/source/propctrlr/handlerhelper.hxx 
b/extensions/source/propctrlr/handlerhelper.hxx
index 761c1d03d250..555b8ee825e8 100644
--- a/extensions/source/propctrlr/handlerhelper.hxx
+++ b/extensions/source/propctrlr/handlerhelper.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 namespace weld { class Builder; class Widget; class Window; }


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

2022-01-04 Thread Tor Lillqvist (via logerrit)
 extensions/source/ole/unoobjw.cxx  |3 ---
 sc/source/core/tool/calcconfig.cxx |2 --
 vcl/quartz/salgdi.cxx  |1 -
 3 files changed, 6 deletions(-)

New commits:
commit 31808345ffd97dfe9d542eae17fadb98148b29c6
Author: Tor Lillqvist 
AuthorDate: Tue Jan 4 13:03:28 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Jan 4 13:40:42 2022 +0100

Drop also commented-out obfuscated SAL_DEBUG calls

Change-Id: I7bc8ee2e5e989e41fcc0b6f96c5b2b8f151cdd3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127937
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/extensions/source/ole/unoobjw.cxx 
b/extensions/source/ole/unoobjw.cxx
index 034d7cec62a1..28286bddb1e3 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -2375,9 +2375,7 @@ Sink::Call( const OUString& Method, Sequence< Any >& 
Arguments )
 aDispParams.rgvarg[j].vt |= VT_BYREF;
 break;
 case VT_BOOL:
-// SAL_ DEBUG("===> VT_BOOL is initially " << 
(int)aDispParams.rgvarg[j].boolVal);
 aDispParams.rgvarg[j].byref = new 
VARIANT_BOOL(aDispParams.rgvarg[j].boolVal);
-// SAL_ DEBUG(" byref=" << 
aDispParams.rgvarg[j].byref);
 aDispParams.rgvarg[j].vt |= VT_BYREF;
 break;
 default:
@@ -2443,7 +2441,6 @@ Sink::Call( const OUString& Method, Sequence< Any >& 
Arguments )
 case VT_BYREF|VT_BOOL:
 {
 VARIANT_BOOL *pBool = 
static_cast(aDispParams.rgvarg[j].byref);
-// SAL_ DEBUG("===> VT_BOOL: byref is now " << 
aDispParams.rgvarg[j].byref << ", " << (int)*pBool);
 ArgumentsRange[nIncomingArgIndex] <<= (*pBool != 
VARIANT_FALSE);
 delete pBool;
 }
diff --git a/sc/source/core/tool/calcconfig.cxx 
b/sc/source/core/tool/calcconfig.cxx
index adb51efdf1ff..f1673e0ebe68 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -95,8 +95,6 @@ ScCalcConfig::ScCalcConfig() :
 mbHasStringRefSyntax(false)
 {
 setOpenCLConfigToDefault();
-
-// SAL _DEBUG(__FILE__ ":" << __LINE__ << ": ScCalcConfig::ScCalcConfig(): 
" << *this);
 }
 
 void ScCalcConfig::setOpenCLConfigToDefault()
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 9928cc4df3a2..51ffda669832 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -252,7 +252,6 @@ SalGraphicsImpl* AquaSalGraphics::GetImpl() const
 void AquaSalGraphics::SetTextColor( Color nColor )
 {
 maShared.maTextColor = nColor;
-// SAL_ DEBUG(std::hex << nColor << std::dec << "={" << 
maShared.maTextColor.GetRed() << ", " << maShared.maTextColor.GetGreen() << ", 
" << maShared.maTextColor.GetBlue() << ", " << maShared.maTextColor.GetAlpha() 
<< "}");
 }
 
 void AquaSalGraphics::GetFontMetric(ImplFontMetricDataRef& rxFontMetric, int 
nFallbackLevel)


[Libreoffice-commits] core.git: extensions/source include/rtl sc/source svl/source svtools/source sw/source tools/source vcl/source

2022-01-02 Thread Mike Kaganski (via logerrit)
 extensions/source/propctrlr/browserline.cxx |2 +-
 include/rtl/ustrbuf.hxx |5 +
 include/rtl/ustring.hxx |   16 
 sc/source/core/tool/compiler.cxx|2 +-
 svl/source/numbers/zformat.cxx  |2 +-
 svtools/source/svrtf/parrtf.cxx |2 +-
 sw/source/filter/ww8/ww8par2.cxx|2 +-
 tools/source/fsys/urlobj.cxx|6 ++
 vcl/source/control/field.cxx|4 ++--
 9 files changed, 30 insertions(+), 11 deletions(-)

New commits:
commit 9f4aad493c7087256d03b01ca3fb18d96f461526
Author: Mike Kaganski 
AuthorDate: Sun Dec 26 09:11:53 2021 +0100
Commit: Mike Kaganski 
CommitDate: Sun Jan 2 09:03:32 2022 +0100

Introduce OUString::unacquired(const OUStringBuffer&)

... and avoid OUStringBuffer::toString when the temporary is used
for checking current buffer content

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

diff --git a/extensions/source/propctrlr/browserline.cxx 
b/extensions/source/propctrlr/browserline.cxx
index a42b63c10e9b..814c24f4b306 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -179,7 +179,7 @@ namespace pcr
 OUStringBuffer aText(m_xFtTitle->get_label());
 
 int n10DotsWidth = m_xFtTitle->get_pixel_size("..").Width();
-int nTextWidth = m_xFtTitle->get_pixel_size(aText.toString()).Width();
+int nTextWidth = 
m_xFtTitle->get_pixel_size(OUString::unacquired(aText)).Width();
 int nDiff = m_nNameWidth - nTextWidth;
 int nExtraChars = (nDiff * 10) / n10DotsWidth;
 for (int i = 0; i < nExtraChars; ++i)
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 85fe744e9ee1..d35200643e01 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -1765,6 +1765,11 @@ template<> struct ToStringHelper {
 else
 return internalAppend(str.pData);
 }
+
+inline OUString const& OUString::unacquired(const OUStringBuffer& str)
+{
+return unacquired();
+}
 #endif
 }
 
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 13cc367c5589..cad257caeb58 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -541,6 +541,22 @@ public:
 static OUString const & unacquired( rtl_uString * const * ppHandle )
 { return * reinterpret_cast< OUString const * >( ppHandle ); }
 
+#if defined LIBO_INTERNAL_ONLY
+/** Provides an OUString const & passing an OUStringBuffer const reference.
+It is more convenient to use C++ OUString member functions when 
checking
+current buffer content. Use this function instead of toString (that
+allocates a new OUString from buffer data) when the result is used in
+comparisons.
+
+@param str
+   an OUStringBuffer
+@return
+   OUString const & based on given storage
+@since LibreOffice 7.4
+*/
+static OUString const& unacquired(const OUStringBuffer& str);
+#endif
+
 /**
   Assign a new string.
 
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 42385b3441cf..0858487b2836 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -666,7 +666,7 @@ static bool lcl_parseExternalName(
 if (aTmpName[nNameLen-1] == '!')
 {
 // Check against #REF!.
-if (aTmpName.toString().equalsIgnoreAsciiCase("#REF!"))
+if (OUString::unacquired(aTmpName).equalsIgnoreAsciiCase("#REF!"))
 return false;
 }
 
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 4b1e2a48c152..3e08154f222a 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2673,7 +2673,7 @@ bool SvNumberformat::ImpGetScientificOutput(double 
fNumber,
 
 if ( rInfo.nCntPre != 1 ) // rescale Exp
 {
-sal_Int32 nExp = ExpStr.toString().toInt32() * nExpSign;
+sal_Int32 nExp = OUString::unacquired(ExpStr).toInt32() * nExpSign;
 sal_Int32 nRescale = (rInfo.nCntPre != 0) ? nExp % 
static_cast(rInfo.nCntPre) : -1;
 if( nRescale < 0 && rInfo.nCntPre != 0 )
 nRescale += static_cast(rInfo.nCntPre);
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index ef6cdbb73620..d16ac8cf0a1e 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -125,7 +125,7 @@ int SvRTFParser::GetNextToken_()
 
aNumber.append(static_cast(nNextCh));
 nNextCh = GetNextChar();
 } while( RTF_ISDIGIT( nNextCh ) );
-nTokenValue = 

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

2021-12-18 Thread Mike Kaganski (via logerrit)
 extensions/source/config/WinUserInfo/WinUserInfoBe.cxx |   24 +
 1 file changed, 13 insertions(+), 11 deletions(-)

New commits:
commit b329502b23c59ff605ff02c3054f1bd2599dde08
Author: Mike Kaganski 
AuthorDate: Sat Dec 18 09:51:38 2021 +0100
Commit: Mike Kaganski 
CommitDate: Sat Dec 18 13:20:47 2021 +0100

Simplify BSTR RAII

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

diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx 
b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
index a54a6b467bc6..a412769ee639 100644
--- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
+++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
@@ -103,15 +103,14 @@ public:
 auto pADsys = 
sal::systools::COMReference().CoCreateInstance(
 CLSID_ADSystemInfo, nullptr, CLSCTX_INPROC_SERVER);
 
-BSTR sUserDN;
-HRESULT hr = pADsys->get_UserName();
+smartBSTR sUserDN;
+HRESULT hr = pADsys->get_UserName();
 if (FAILED(hr))
 throw sal::systools::ComError("get_UserName failed", hr);
-BSTRGuard aUserNameGuard(sUserDN, SysFreeString);
 // If this user is an AD user, then without an active connection 
to the domain, all the
 // above will succeed, and m_sUserDN will be correctly 
initialized, but the following
 // call to ADsGetObject will fail, and we will attempt reading 
cached values.
-m_sUserDN = o3tl::toU(sUserDN);
+m_sUserDN = o3tl::toU(sUserDN.ptr);
 OUString sLdapUserDN = "LDAP://" + m_sUserDN;
 sal::systools::COMReference pUser;
 hr = ADsGetObject(o3tl::toW(sLdapUserDN.getStr()), IID_IADsUser,
@@ -160,26 +159,29 @@ public:
 virtual OUString GetMail() override { return m_aMap[mail]; }
 
 private:
-typedef std::unique_ptr BSTRGuard;
+struct smartBSTR
+{
+BSTR ptr = nullptr;
+~smartBSTR() { SysFreeString(ptr); }
+};
 
 typedef HRESULT (__stdcall IADsUser::*getstrfunc)(BSTR*);
 static OUString Str(IADsUser* pUser, getstrfunc func)
 {
-BSTR sBstr;
-if (FAILED((pUser->*func)()))
+smartBSTR sBstr;
+if (FAILED((pUser->*func)()))
 return "";
-BSTRGuard aBstrGuard(sBstr, SysFreeString);
-return OUString(o3tl::toU(sBstr));
+return OUString(o3tl::toU(sBstr.ptr));
 }
 static OUString Str(IADsUser* pUser, const wchar_t* property)
 {
-BSTRGuard sBstrProp(SysAllocString(property), SysFreeString);
+smartBSTR sBstrProp{ SysAllocString(property) };
 struct AutoVariant : public VARIANT
 {
 AutoVariant() { VariantInit(this); }
 ~AutoVariant() { VariantClear(this); }
 } varArr;
-if (FAILED(pUser->GetEx(sBstrProp.get(), )))
+if (FAILED(pUser->GetEx(sBstrProp.ptr, )))
 return "";
 SAFEARRAY* sa = V_ARRAY();
 LONG nStart, nEnd;


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

2021-12-18 Thread Mike Kaganski (via logerrit)
 extensions/source/config/WinUserInfo/WinUserInfoBe.cxx |   38 -
 1 file changed, 11 insertions(+), 27 deletions(-)

New commits:
commit 8c32e155acf1935c5f6cef5eeda21c3d5f5af46b
Author: Mike Kaganski 
AuthorDate: Sat Dec 18 09:47:33 2021 +0100
Commit: Mike Kaganski 
CommitDate: Sat Dec 18 11:59:35 2021 +0100

Drop CoIfPtr and use sal::systools::COMReference

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

diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx 
b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
index f9f5f9545439..a54a6b467bc6 100644
--- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
+++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
@@ -26,6 +26,8 @@
 #define SECURITY_WIN32
 #include 
 
+#include 
+
 namespace extensions
 {
 namespace config
@@ -92,35 +94,30 @@ public:
 {
 CoInitializeGuard()
 {
-if (FAILED(CoInitializeEx(nullptr, 
COINIT_APARTMENTTHREADED)))
-throw css::uno::RuntimeException();
+if (HRESULT hr = CoInitializeEx(nullptr, 
COINIT_APARTMENTTHREADED); FAILED(hr))
+throw sal::systools::ComError("CoInitializeEx failed", 
hr);
 }
 ~CoInitializeGuard() { CoUninitialize(); }
 } aCoInitializeGuard;
 
-IADsADSystemInfo* pADsys;
-HRESULT hr = CoCreateInstance(CLSID_ADSystemInfo, nullptr, 
CLSCTX_INPROC_SERVER,
-  IID_IADsADSystemInfo, 
reinterpret_cast());
-if (FAILED(hr))
-throw css::uno::RuntimeException();
-CoIfPtr aADsysGuard(pADsys);
+auto pADsys = 
sal::systools::COMReference().CoCreateInstance(
+CLSID_ADSystemInfo, nullptr, CLSCTX_INPROC_SERVER);
 
 BSTR sUserDN;
-hr = pADsys->get_UserName();
+HRESULT hr = pADsys->get_UserName();
 if (FAILED(hr))
-throw css::uno::RuntimeException();
+throw sal::systools::ComError("get_UserName failed", hr);
 BSTRGuard aUserNameGuard(sUserDN, SysFreeString);
 // If this user is an AD user, then without an active connection 
to the domain, all the
 // above will succeed, and m_sUserDN will be correctly 
initialized, but the following
 // call to ADsGetObject will fail, and we will attempt reading 
cached values.
 m_sUserDN = o3tl::toU(sUserDN);
 OUString sLdapUserDN = "LDAP://" + m_sUserDN;
-IADsUser* pUser;
+sal::systools::COMReference pUser;
 hr = ADsGetObject(o3tl::toW(sLdapUserDN.getStr()), IID_IADsUser,
   reinterpret_cast());
 if (FAILED(hr))
-throw css::uno::RuntimeException();
-CoIfPtr pUserGuard(pUser);
+throw sal::systools::ComError("ADsGetObject failed", hr);
 // Fetch all the required information right now, when we know to 
have access to AD
 // (later the connection may already be lost)
 m_aMap[givenname] = Str(pUser, ::get_FirstName);
@@ -140,7 +137,7 @@ public:
 
 CacheData(xContext);
 }
-catch (css::uno::Exception&)
+catch (sal::systools::ComError&)
 {
 // Maybe we temporarily lost connection to AD; try to get cached 
data
 GetCachedData(xContext);
@@ -163,19 +160,6 @@ public:
 virtual OUString GetMail() override { return m_aMap[mail]; }
 
 private:
-static void ReleaseIUnknown(IUnknown* p)
-{
-if (p)
-p->Release();
-}
-template  class CoIfPtr : public std::unique_ptr
-{
-public:
-CoIfPtr(If* p = nullptr)
-: std::unique_ptr(p, 
ReleaseIUnknown)
-{
-}
-};
 typedef std::unique_ptr BSTRGuard;
 
 typedef HRESULT (__stdcall IADsUser::*getstrfunc)(BSTR*);


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

2021-12-10 Thread Caolán McNamara (via logerrit)
 extensions/source/scanner/sane.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6494fba15ea93283b625bf6bdb4666709f22439f
Author: Caolán McNamara 
AuthorDate: Fri Dec 10 15:34:05 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 10 17:44:42 2021 +0100

more ofz#42182 oss-build failure

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

diff --git a/extensions/source/scanner/sane.cxx 
b/extensions/source/scanner/sane.cxx
index 20bce0be68d0..de03e1158775 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -169,8 +169,8 @@ Sane::~Sane()
 
 void Sane::Init()
 {
-OUString sSaneLibName( "libsane" SAL_DLLEXTENSION  );
 #ifndef DISABLE_DYNLOADING
+OUString sSaneLibName( "libsane" SAL_DLLEXTENSION  );
 pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY );
 if( ! pSaneLib )
 {
@@ -244,7 +244,9 @@ void Sane::DeInit()
 if( pSaneLib )
 {
 p_exit();
+#ifndef DISABLE_DYNLOADING
 osl_unloadModule( pSaneLib );
+#endif
 pSaneLib = nullptr;
 }
 }


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

2021-12-10 Thread Caolán McNamara (via logerrit)
 extensions/source/scanner/sane.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ecd8f448327fbdfcef86e8706ee8b74e3b886dce
Author: Caolán McNamara 
AuthorDate: Fri Dec 10 14:08:15 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 10 15:46:54 2021 +0100

ofz#42182 oss-build failure

possibly since:

commit db3a61cd958f4a70417929cf8e1fa9bfd0bfe5a3
Author: Stephan Bergmann 
Date:   Thu Dec 9 10:15:05 2021 +0100

Generally determine Rdb content from gb_*_set_componentfile calls

(?)

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

diff --git a/extensions/source/scanner/sane.cxx 
b/extensions/source/scanner/sane.cxx
index 839602458e6e..20bce0be68d0 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -170,6 +170,7 @@ Sane::~Sane()
 void Sane::Init()
 {
 OUString sSaneLibName( "libsane" SAL_DLLEXTENSION  );
+#ifndef DISABLE_DYNLOADING
 pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY );
 if( ! pSaneLib )
 {
@@ -183,7 +184,7 @@ void Sane::Init()
 osl_getFileURLFromSystemPath( sSaneLibSystemPath.pData, 
 );
 pSaneLib = osl_loadModule( sSaneLibName.pData, SAL_LOADMODULE_LAZY );
 }
-
+#endif
 if( pSaneLib )
 {
 bSaneSymbolLoadFailed = false;


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

2021-12-10 Thread Caolán McNamara (via logerrit)
 extensions/source/activex/SOActiveX.cxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 9e8789f2186d16a895cd659b321e5001ea239658
Author: Caolán McNamara 
AuthorDate: Thu Dec 9 15:22:22 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 10 10:03:02 2021 +0100

remove use of non-existing slot:6661

seeing as this call does nothing since ~2006

see:
commit 01552f1e77c67f70ffd879294288612f9ab64e3b
Author: Stephan Bergmann 
Date:   Fri Oct 17 16:58:26 2014 +0200

SID_TOGGLE_MENUBAR (aka slot:6661, .uno:MenuBarVisible) is dead

...since introduction of XLayoutManager's 
private:resource/menubar/menubar in
3fb2acf5b77bff59909f616c44c7de17048b64d7 "INTEGRATION: CWS layoutmanager
(1.52.10); FILE MERGED" etc. and final removal of SID_TOGGLE_MENUBAR 
bits in
f605b16e395e8ccc3d1aba7907b0792039016f69 "INTEGRATION: CWS sfxcleanup 
(1.119.8);
FILE MERGED" etc.

What still needs fixing are

  extensions/source/activex/SOActiveX.cxx
  
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
  odk/examples/OLE/activex/SOActiveX.cpp

in a similar way as e.g. 0273d3d81d29d5c1f6c387cca633cd99722c100e 
"INTEGRATION:
CWS jl18 (1.6.8); FILE MERGED."

these uses remain outstanding:
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
odk/examples/OLE/activex/SOActiveX.cpp

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

diff --git a/extensions/source/activex/SOActiveX.cxx 
b/extensions/source/activex/SOActiveX.cxx
index 6e102cf51202..2d8dc2a73b91 100644
--- a/extensions/source/activex/SOActiveX.cxx
+++ b/extensions/source/activex/SOActiveX.cxx
@@ -801,13 +801,6 @@ HRESULT CSOActiveX::LoadURLToFrame( )
 HRESULT hr = CallDispatchMethod( mCurFileUrl, aArgNames, aArgVals, nCount 
);
 if( !SUCCEEDED( hr ) ) return hr;
 
-CComVariant aBarName( L"MenuBarVisible" );
-CComVariant aBarVis;
-aBarVis.vt = VT_BOOL; aBarVis.boolVal = VARIANT_FALSE;
-hr = CallDispatchMethod( L"slot:6661", , , 1 );
-// does not work for some documents, but it is no error
-// if( !SUCCEEDED( hr ) ) return hr;
-
 // try to get the model and set the presentation specific property, the 
setting will fail for other document formats
 CComPtr pdispController;
 hr = GetIDispByFunc( mpDispFrame, L"getController", nullptr, 0, 
pdispController );


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

2021-11-30 Thread Stephan Bergmann (via logerrit)
 extensions/source/logging/csvformatter.cxx |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 33a7e65502857687e778444c9b55500b40b4df19
Author: Stephan Bergmann 
AuthorDate: Tue Nov 30 12:42:21 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 30 16:11:49 2021 +0100

Improve an snprintf printing css::util::DateTime members

...to avoid GCC 12 trunk

> extensions/source/logging/csvformatter.cxx: In member function ‘virtual 
rtl::OUString logging::{anonymous}::CsvFormatter::format(const 
com::sun::star::logging::LogRecord&)’:
> extensions/source/logging/csvformatter.cxx:241:70: error: ‘%02i’ 
directive output may be truncated writing between 2 and 5 bytes into a region 
of size between 0 and 14 [-Werror=format-truncation=]
>   241 | snprintf( buffer, buffer_size, 
"%04i-%02i-%02iT%02i:%02i:%02i.%09i",
>   |   
   ^~~~
> extensions/source/logging/csvformatter.cxx:241:44: note: directive 
argument in the range [0, 65535]
>   241 | snprintf( buffer, buffer_size, 
"%04i-%02i-%02iT%02i:%02i:%02i.%09i",
>   |
^~~~
> extensions/source/logging/csvformatter.cxx:241:44: note: using the range 
[-2147483648, 2147483647] for directive argument
> extensions/source/logging/csvformatter.cxx:241:21: note: ‘snprintf’ 
output between 30 and 49 bytes into a destination of size 31
>   241 | snprintf( buffer, buffer_size, 
"%04i-%02i-%02iT%02i:%02i:%02i.%09i",
>   | 
^~~~
>   242 | static_cast(record.LogTime.Year),
>   | ~~
>   243 | static_cast(record.LogTime.Month),
>   | ~~~
>   244 | static_cast(record.LogTime.Day),
>   | ~
>   245 | static_cast(record.LogTime.Hours),
>   | ~~~
>   246 | static_cast(record.LogTime.Minutes),
>   | ~
>   247 | static_cast(record.LogTime.Seconds),
>   | ~
>   248 | static_cast(record.LogTime.NanoSeconds) );
>   | ~~

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

diff --git a/extensions/source/logging/csvformatter.cxx 
b/extensions/source/logging/csvformatter.cxx
index 0d0ec6479c5e..8e749db42831 100644
--- a/extensions/source/logging/csvformatter.cxx
+++ b/extensions/source/logging/csvformatter.cxx
@@ -28,6 +28,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -236,16 +238,16 @@ namespace logging
 }
 
 // ISO 8601
-char buffer[ 31 ];
+char buffer[ 
SAL_N_ELEMENTS("-32768-65535-65535T65535:65535:65535.4294967295") ];
 const size_t buffer_size = sizeof( buffer );
-snprintf( buffer, buffer_size, 
"%04i-%02i-%02iT%02i:%02i:%02i.%09i",
+snprintf( buffer, buffer_size, "%04i-%02u-%02uT%02u:%02u:%02u.%09" 
SAL_PRIuUINT32,
 static_cast(record.LogTime.Year),
-static_cast(record.LogTime.Month),
-static_cast(record.LogTime.Day),
-static_cast(record.LogTime.Hours),
-static_cast(record.LogTime.Minutes),
-static_cast(record.LogTime.Seconds),
-static_cast(record.LogTime.NanoSeconds) );
+static_cast(record.LogTime.Month),
+static_cast(record.LogTime.Day),
+static_cast(record.LogTime.Hours),
+static_cast(record.LogTime.Minutes),
+static_cast(record.LogTime.Seconds),
+record.LogTime.NanoSeconds );
 aLogEntry.appendAscii( buffer );
 aLogEntry.append(comma_char);
 }


[Libreoffice-commits] core.git: extensions/source filter/source include/comphelper package/source sfx2/source sot/source xmloff/source

2021-11-24 Thread Noel Grandin (via logerrit)
 extensions/source/activex/so_activex.cxx   |   78 ++---
 filter/source/storagefilterdetect/filterdetect.cxx |   52 +++---
 include/comphelper/documentconstants.hxx   |   71 +--
 include/comphelper/storagehelper.hxx   |   16 ++--
 package/source/manifest/ManifestExport.cxx |4 -
 package/source/zippackage/ZipPackage.cxx   |2 
 sfx2/source/doc/objmisc.cxx|2 
 sfx2/source/doc/objserv.cxx|4 -
 sfx2/source/doc/objstor.cxx|2 
 sot/source/base/exchange.cxx   |   22 ++---
 xmloff/source/core/xmlimp.cxx  |2 
 xmloff/source/style/GradientStyle.cxx  |2 
 xmloff/source/style/TransGradientStyle.cxx |2 
 13 files changed, 130 insertions(+), 129 deletions(-)

New commits:
commit a069fac4a08f93db74799d00f047e04f1a0735cd
Author: Noel Grandin 
AuthorDate: Fri Nov 19 09:50:52 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 24 13:23:59 2021 +0100

loplugin:stringliteraldefine in comphelper

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

diff --git a/extensions/source/activex/so_activex.cxx 
b/extensions/source/activex/so_activex.cxx
index 5840e36b6521..c8e8828bdd93 100644
--- a/extensions/source/activex/so_activex.cxx
+++ b/extensions/source/activex/so_activex.cxx
@@ -178,43 +178,43 @@ const char* const aFileExt[] = { ".vor",
".sxw", ".sxc", ".sxi", ".sxd", ".sxg", ".sxm",
".ott", ".otg", ".otp", ".ots", ".otf",
".odt", ".oth", ".odm", ".odg", ".odp", ".ods", 
".odf"};
-const char* const aMimeType[] = {
-  "application/vnd.stardivision.writer",
-
-  "application/vnd.stardivision.chart",
-  "application/vnd.stardivision.draw",
-  "application/vnd.stardivision.impress",
-  "application/vnd.stardivision.impress-packed",
-  "application/vnd.stardivision.calc",
-  "application/vnd.stardivision.writer",
-  "application/vnd.stardivision.math",
-
-  MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII,
-  MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII,
-  MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII,
-  MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII,
-
-  MIMETYPE_VND_SUN_XML_WRITER_ASCII,
-  MIMETYPE_VND_SUN_XML_CALC_ASCII,
-  MIMETYPE_VND_SUN_XML_IMPRESS_ASCII,
-  MIMETYPE_VND_SUN_XML_DRAW_ASCII,
-  MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII,
-  MIMETYPE_VND_SUN_XML_MATH_ASCII,
-
-  MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII,
-  
MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII,
-  
MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII,
-  
MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII,
-
-  MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII,
-  MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII };
+const sal_Unicode* const aMimeType[] = {
+  u"application/vnd.stardivision.writer",
+
+  u"application/vnd.stardivision.chart",
+  u"application/vnd.stardivision.draw",
+  u"application/vnd.stardivision.impress",
+  u"application/vnd.stardivision.impress-packed",
+  u"application/vnd.stardivision.calc",
+  u"application/vnd.stardivision.writer",
+  u"application/vnd.stardivision.math",
+
+  MIMETYPE_VND_SUN_XML_WRITER_TEMPLATE_ASCII.getStr(),
+  MIMETYPE_VND_SUN_XML_CALC_TEMPLATE_ASCII.getStr(),
+  MIMETYPE_VND_SUN_XML_IMPRESS_TEMPLATE_ASCII.getStr(),
+  MIMETYPE_VND_SUN_XML_DRAW_TEMPLATE_ASCII.getStr(),
+
+ 

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

2021-11-20 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |   19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 6d528515c5ed809da7ecfe27d105cfb173c9f768
Author: Mike Kaganski 
AuthorDate: Sat Nov 20 09:32:32 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sat Nov 20 10:58:51 2021 +0100

Don't loose scanned image's resolution precision

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index ab99ab332572..beca35f4f26b 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -36,10 +36,7 @@
 
 namespace
 {
-TW_INT32 FixToInt32(const TW_FIX32& rFix)
-{
-return static_cast(floor(rFix.Whole + rFix.Frac / 65536. + 0.5));
-}
+double FixToDouble(const TW_FIX32& rFix) { return rFix.Whole + rFix.Frac / 
65536.; }
 
 const wchar_t sTwainWndClass[] = L"TwainClass";
 
@@ -383,12 +380,12 @@ void ImpTwain::ImplXfer()
 {
 TW_IMAGEINFO aInfo;
 HANDLE hDIB = nullptr;
-TW_INT32 nXRes, nYRes;
+double nXRes, nYRes;
 
 if (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, 
) == TWRC_SUCCESS)
 {
-nXRes = FixToInt32(aInfo.XResolution);
-nYRes = FixToInt32(aInfo.YResolution);
+nXRes = FixToDouble(aInfo.XResolution);
+nYRes = FixToDouble(aInfo.YResolution);
 }
 else
 nXRes = nYRes = -1;
@@ -411,15 +408,15 @@ void ImpTwain::ImplXfer()
 {
 if (LPVOID pBmpMem = GlobalLock(hGlob))
 {
-if ((nXRes != -1) && (nYRes != -1))
+if ((nXRes > 0) && (nYRes > 0))
 {
 // set resolution of bitmap
 BITMAPINFOHEADER* pBIH = 
static_cast(pBmpMem);
 
-static const auto[m, d]
+const auto[m, d]
 = getConversionMulDiv(o3tl::Length::in, 
o3tl::Length::m);
-pBIH->biXPelsPerMeter = o3tl::convert(nXRes, 
d, m);
-pBIH->biYPelsPerMeter = o3tl::convert(nYRes, 
d, m);
+pBIH->biXPelsPerMeter = 
std::round(o3tl::convert(nXRes, d, m));
+pBIH->biYPelsPerMeter = 
std::round(o3tl::convert(nYRes, d, m));
 }
 
 HANDLE hMap = 
CreateFileMappingW(INVALID_HANDLE_VALUE, nullptr,


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

2021-11-20 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 867abf5b8eff8733dd7ad020d16724ed8eda3885
Author: Mike Kaganski 
AuthorDate: Sat Nov 13 12:19:49 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sat Nov 20 10:58:33 2021 +0100

Drop unused variables - again

This re-instates commit a339ebca55f53db5f0b72b26fcfbb3aaa2b2a825
"Drop unused variables", that was accidentally reverted in
commit 1b6e3efe964eec9110e656a8242f6f4d8b5e7f7e "Simplify
m_aAppId initialization".

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 254ed747281d..ab99ab332572 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -383,17 +383,15 @@ void ImpTwain::ImplXfer()
 {
 TW_IMAGEINFO aInfo;
 HANDLE hDIB = nullptr;
-TW_INT32 nWidth, nHeight, nXRes, nYRes;
+TW_INT32 nXRes, nYRes;
 
 if (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, 
) == TWRC_SUCCESS)
 {
-nWidth = aInfo.ImageWidth;
-nHeight = aInfo.ImageLength;
 nXRes = FixToInt32(aInfo.XResolution);
 nYRes = FixToInt32(aInfo.YResolution);
 }
 else
-nWidth = nHeight = nXRes = nYRes = -1;
+nXRes = nYRes = -1;
 
 switch (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGENATIVEXFER, 
MSG_GET, ))
 {
@@ -413,7 +411,7 @@ void ImpTwain::ImplXfer()
 {
 if (LPVOID pBmpMem = GlobalLock(hGlob))
 {
-if ((nXRes != -1) && (nYRes != -1) && (nWidth != 
-1) && (nHeight != -1))
+if ((nXRes != -1) && (nYRes != -1))
 {
 // set resolution of bitmap
 BITMAPINFOHEADER* pBIH = 
static_cast(pBmpMem);


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

2021-11-19 Thread Hossein (via logerrit)
 extensions/source/scanner/twain32shim.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit aadb472a6d37d57279f91038f28047af4278bbbc
Author: Hossein 
AuthorDate: Fri Nov 19 22:39:10 2021 +0100
Commit: Mike Kaganski 
CommitDate: Sat Nov 20 07:13:14 2021 +0100

Use o3tl::convert

Used o3tl::convert on nXRes and nYRes to calculate biXPelsPerMeter
and biYPelsPerMeter for the bitmap information header structure pBIH:

https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader

The values of biXPelsPerMeter and biYPelsPerMeter are always ignored
by the GDI when loading the bitmaps, but in theory they can be
recommendations for the pysical size of a bitmap in some applications.
https://devblogs.microsoft.com/oldnewthing/20130515-00/?p=4363

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index eab704fcb8db..254ed747281d 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -30,6 +30,7 @@
 #include "twain32shim.hxx"
 #include 
 #include 
+#include 
 
 #define WM_TWAIN_FALLBACK (WM_SHIM_INTERNAL + 0)
 
@@ -416,10 +417,11 @@ void ImpTwain::ImplXfer()
 {
 // set resolution of bitmap
 BITMAPINFOHEADER* pBIH = 
static_cast(pBmpMem);
-static const double fFactor = 100.0 / 2.54;
 
-pBIH->biXPelsPerMeter = FRound(fFactor * 
nXRes);
-pBIH->biYPelsPerMeter = FRound(fFactor * 
nYRes);
+static const auto[m, d]
+= getConversionMulDiv(o3tl::Length::in, 
o3tl::Length::m);
+pBIH->biXPelsPerMeter = o3tl::convert(nXRes, 
d, m);
+pBIH->biYPelsPerMeter = o3tl::convert(nYRes, 
d, m);
 }
 
 HANDLE hMap = 
CreateFileMappingW(INVALID_HANDLE_VALUE, nullptr,


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

2021-11-19 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/updatehdl.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 168ae4c00a86b7534dedd303f9ef008e19822b99
Author: Stephan Bergmann 
AuthorDate: Fri Nov 19 14:17:33 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 19 15:33:10 2021 +0100

Fix --enable-online-update

...after 4bc44490f51f7cc4a36cc7131137018da986c293
"loplugin:stringliteraldefine in tools"

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

diff --git a/extensions/source/update/check/updatehdl.cxx 
b/extensions/source/update/check/updatehdl.cxx
index 74f7b857828c..b0ecb69e37f9 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -142,7 +142,7 @@ void UpdateHandler::setDownloadBtnLabel( bool bAppendDots )
 aLabel += "...";
 
 setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "Label", uno::Any( 
aLabel ) );
-setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", 
uno::makeAny( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD2 ) );
+setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", 
uno::makeAny( INET_HID_SCHEME + HID_CHECK_FOR_UPD_DOWNLOAD2 ) );
 
 mbDownloadBtnHasDots = bAppendDots;
 }
@@ -1032,7 +1032,7 @@ void UpdateHandler::createDialog()
 xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) );
 xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH 
)) );
 xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( 
DIALOG_HEIGHT )) );
-xPropSet->setPropertyValue( "HelpURL", uno::makeAny( 
INET_HID_SCHEME HID_CHECK_FOR_UPD_DLG ) );
+xPropSet->setPropertyValue( "HelpURL", uno::makeAny( 
INET_HID_SCHEME + HID_CHECK_FOR_UPD_DLG ) );
 }
 {   // Label (fixed text) 
 uno::Sequence< beans::NamedValue > aProps { { "Label", uno::Any( 
msStatusFL ) } };
@@ -1057,7 +1057,7 @@ void UpdateHandler::createDialog()
 { "MultiLine", uno::Any( true ) },
 { "ReadOnly", uno::Any( true ) },
 { "AutoVScroll", uno::Any( true ) },
-{ "HelpURL", uno::makeAny( INET_HID_SCHEME 
HID_CHECK_FOR_UPD_STATUS ) }
+{ "HelpURL", uno::makeAny( INET_HID_SCHEME + 
HID_CHECK_FOR_UPD_STATUS ) }
 };
 
 insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_STATUS,
@@ -1090,7 +1090,7 @@ void UpdateHandler::createDialog()
 { "Enabled", uno::Any( true ) },
 { "PushButtonType", uno::Any( 
sal_Int16(awt::PushButtonType_STANDARD) ) },
 { "Label", uno::Any( msPauseBtn ) },
-{ "HelpURL", uno::makeAny( INET_HID_SCHEME 
HID_CHECK_FOR_UPD_PAUSE ) }
+{ "HelpURL", uno::makeAny( INET_HID_SCHEME + 
HID_CHECK_FOR_UPD_PAUSE ) }
 };
 
 insertControlModel ( xControlModel, BUTTON_MODEL, 
msButtonIDs[PAUSE_BUTTON],
@@ -1104,7 +1104,7 @@ void UpdateHandler::createDialog()
 { "Enabled", uno::Any( true ) },
 { "PushButtonType", uno::Any( 
sal_Int16(awt::PushButtonType_STANDARD) ) },
 { "Label", uno::Any( msResumeBtn ) },
-{ "HelpURL", uno::makeAny( INET_HID_SCHEME 
HID_CHECK_FOR_UPD_RESUME ) }
+{ "HelpURL", uno::makeAny( INET_HID_SCHEME + 
HID_CHECK_FOR_UPD_RESUME ) }
 };
 
 insertControlModel ( xControlModel, BUTTON_MODEL, 
msButtonIDs[RESUME_BUTTON],
@@ -1121,7 +1121,7 @@ void UpdateHandler::createDialog()
 { "Enabled", uno::Any( true ) },
 { "PushButtonType", uno::Any( 
sal_Int16(awt::PushButtonType_STANDARD) ) },
 { "Label", uno::Any( msCancelBtn ) },
-{ "HelpURL", uno::makeAny( INET_HID_SCHEME 
HID_CHECK_FOR_UPD_CANCEL ) }
+{ "HelpURL", uno::makeAny( INET_HID_SCHEME + 
HID_CHECK_FOR_UPD_CANCEL ) }
 };
 
 insertControlModel ( xControlModel, BUTTON_MODEL, 
msButtonIDs[CANCEL_BUTTON],
@@ -1154,7 +1154,7 @@ void UpdateHandler::createDialog()
 { "MultiLine", uno::Any( true ) },
 { "ReadOnly", uno::Any( true ) },
 { "AutoVScroll", uno::Any( true ) },
-{ "HelpURL", uno::makeAny( INET_HID_SCHEME 
HID_CHECK_FOR_UPD_DESCRIPTION ) }
+{ "HelpURL", uno::makeAny( INET_HID_SCHEME + 
HID_CHECK_FOR_UPD_DESCRIPTION ) }
 };
 
 insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_DESCRIPTION,
@@ -1183,7 +1183,7 @@ void UpdateHandler::createDialog()
 // setProperty( aProps, 2, "PushButtonType", uno::Any( 
sal_Int16(awt::PushButtonType_CANCEL) ) );
 // [property] string Label // only if PushButtonType_STANDARD
 { "Label", uno::Any( msClose ) },
-{ "HelpURL", uno::makeAny( INET_HID_SCHEME 
HID_CHECK_FOR_UPD_CLOSE ) }
+{ "HelpURL", uno::makeAny( 

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

2021-11-13 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |   39 +-
 1 file changed, 18 insertions(+), 21 deletions(-)

New commits:
commit 1b6e3efe964eec9110e656a8242f6f4d8b5e7f7e
Author: Mike Kaganski 
AuthorDate: Sat Nov 13 14:05:41 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sat Nov 13 15:55:54 2021 +0100

Simplify m_aAppId initialization

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 8821a3b0cabc..eab704fcb8db 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -169,26 +169,21 @@ HANDLE GetProcOfThread(HANDLE hThread)
 }
 
 ImpTwain::ImpTwain(HANDLE hParentThread)
-: m_nParentThreadId(GetThreadId(hParentThread))
+: m_aAppId{ /* Id  */ 0,
+{ /* Version.MajorNum */ 1,
+  /* Version.MinorNum */ 0,
+  /* Version.Language */ TWLG_USA,
+  /* Version.Country  */ TWCY_USA,
+  /* Version.Info */ "8.0" },
+/* ProtocolMajor   */ TWON_PROTOCOLMAJOR,
+/* ProtocolMinor   */ TWON_PROTOCOLMINOR,
+/* SupportedGroups */ DG_IMAGE | DG_CONTROL,
+/* Manufacturer*/ "Sun Microsystems",
+/* ProductFamily   */ "Office",
+/* ProductName */ "Office" }
+, m_nParentThreadId(GetThreadId(hParentThread))
 , m_hProc(GetProcOfThread(hParentThread))
 {
-m_aAppId.Id = 0;
-m_aAppId.Version.MajorNum = 1;
-m_aAppId.Version.MinorNum = 0;
-m_aAppId.Version.Language = TWLG_USA;
-m_aAppId.Version.Country = TWCY_USA;
-m_aAppId.ProtocolMajor = TWON_PROTOCOLMAJOR;
-m_aAppId.ProtocolMinor = TWON_PROTOCOLMINOR;
-m_aAppId.SupportedGroups = DG_IMAGE | DG_CONTROL;
-strncpy(m_aAppId.Version.Info, "8.0", 32);
-m_aAppId.Version.Info[32] = m_aAppId.Version.Info[33] = 0;
-strncpy(m_aAppId.Manufacturer, "Sun Microsystems", 32);
-m_aAppId.Manufacturer[32] = m_aAppId.Manufacturer[33] = 0;
-strncpy(m_aAppId.ProductFamily, "Office", 32);
-m_aAppId.ProductFamily[32] = m_aAppId.ProductFamily[33] = 0;
-strncpy(m_aAppId.ProductName, "Office", 32);
-m_aAppId.ProductName[32] = m_aAppId.ProductName[33] = 0;
-
 WNDCLASSW aWc = { 0,   , 0,   sizeof(WNDCLASSW), 
GetModuleHandleW(nullptr),
   nullptr, nullptr,  nullptr, nullptr,   
sTwainWndClass };
 if (!RegisterClassW())
@@ -387,15 +382,17 @@ void ImpTwain::ImplXfer()
 {
 TW_IMAGEINFO aInfo;
 HANDLE hDIB = nullptr;
-TW_INT32 nXRes, nYRes;
+TW_INT32 nWidth, nHeight, nXRes, nYRes;
 
 if (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, 
) == TWRC_SUCCESS)
 {
+nWidth = aInfo.ImageWidth;
+nHeight = aInfo.ImageLength;
 nXRes = FixToInt32(aInfo.XResolution);
 nYRes = FixToInt32(aInfo.YResolution);
 }
 else
-nXRes = nYRes = -1;
+nWidth = nHeight = nXRes = nYRes = -1;
 
 switch (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGENATIVEXFER, 
MSG_GET, ))
 {
@@ -415,7 +412,7 @@ void ImpTwain::ImplXfer()
 {
 if (LPVOID pBmpMem = GlobalLock(hGlob))
 {
-if ((nXRes != -1) && (nYRes != -1))
+if ((nXRes != -1) && (nYRes != -1) && (nWidth != 
-1) && (nHeight != -1))
 {
 // set resolution of bitmap
 BITMAPINFOHEADER* pBIH = 
static_cast(pBmpMem);


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

2021-11-13 Thread Mike Kaganski (via logerrit)
 extensions/source/scanner/twain32shim.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit a339ebca55f53db5f0b72b26fcfbb3aaa2b2a825
Author: Mike Kaganski 
AuthorDate: Sat Nov 13 12:19:49 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sat Nov 13 12:12:45 2021 +0100

Drop unused variables

nWidth/nHeight (1) are irrelevant here (we get the correct pixel size
right in the hDIB), and (2) should not be -1, because we don't use
ICAP_UNDEFINEDIMAGESIZE capability [1].

[1] 
https://twain.org/wp-content/uploads/2017/03/TWAIN-2.4-Specification.pdf#page=268

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

diff --git a/extensions/source/scanner/twain32shim.cxx 
b/extensions/source/scanner/twain32shim.cxx
index 0a34fa13ce7e..8821a3b0cabc 100644
--- a/extensions/source/scanner/twain32shim.cxx
+++ b/extensions/source/scanner/twain32shim.cxx
@@ -387,17 +387,15 @@ void ImpTwain::ImplXfer()
 {
 TW_IMAGEINFO aInfo;
 HANDLE hDIB = nullptr;
-TW_INT32 nWidth, nHeight, nXRes, nYRes;
+TW_INT32 nXRes, nYRes;
 
 if (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, 
) == TWRC_SUCCESS)
 {
-nWidth = aInfo.ImageWidth;
-nHeight = aInfo.ImageLength;
 nXRes = FixToInt32(aInfo.XResolution);
 nYRes = FixToInt32(aInfo.YResolution);
 }
 else
-nWidth = nHeight = nXRes = nYRes = -1;
+nXRes = nYRes = -1;
 
 switch (m_pDSM(_aAppId, _aSrcId, DG_IMAGE, DAT_IMAGENATIVEXFER, 
MSG_GET, ))
 {
@@ -417,7 +415,7 @@ void ImpTwain::ImplXfer()
 {
 if (LPVOID pBmpMem = GlobalLock(hGlob))
 {
-if ((nXRes != -1) && (nYRes != -1) && (nWidth != 
-1) && (nHeight != -1))
+if ((nXRes != -1) && (nYRes != -1))
 {
 // set resolution of bitmap
 BITMAPINFOHEADER* pBIH = 
static_cast(pBmpMem);


[Libreoffice-commits] core.git: extensions/source sfx2/source svx/source sw/source vcl/source

2021-11-03 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/formcomponenthandler.cxx |4 ++--
 sfx2/source/doc/doctempl.cxx |2 +-
 svx/source/form/fmshimp.cxx  |2 +-
 svx/source/tbxctrls/extrusioncontrols.cxx|2 +-
 sw/source/uibase/utlui/initui.cxx|2 +-
 vcl/source/gdi/print.cxx |2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 23c8da878529f85ba5045db6f7ea7956a64dfc72
Author: Caolán McNamara 
AuthorDate: Wed Nov 3 09:22:57 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 3 11:57:03 2021 +0100

put the message into static_assert

and use more static_assert where its obviously possible

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

diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index a783f1e49bd0..ebb30470a6db 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -519,7 +519,7 @@ namespace pcr
 if( ! (_rControlValue >>= sControlValue) )
 SAL_WARN("extensions.propctrlr", "convertToControlValue: 
unable to get property for Show/Hide");
 
-assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2 && 
"FormComponentPropertyHandler::convertToPropertyValue: broken resource for 
Show/Hide!");
+static_assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE), 
"FormComponentPropertyHandler::convertToPropertyValue: broken resource for 
Show/Hide!");
 bool bShow = sControlValue == PcrRes(RID_RSC_ENUM_SHOWHIDE[1]);
 
 aPropertyValue <<= bShow;
@@ -627,7 +627,7 @@ namespace pcr
 case PROPERTY_ID_SHOW_RECORDACTIONS:
 case PROPERTY_ID_SHOW_FILTERSORT:
 {
-assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2 && 
"FormComponentPropertyHandler::convertToPropertyValue: broken resource for 
Show/Hide!");
+static_assert(SAL_N_ELEMENTS(RID_RSC_ENUM_SHOWHIDE) == 2, 
"FormComponentPropertyHandler::convertToPropertyValue: broken resource for 
Show/Hide!");
 OUString sControlValue = ::comphelper::getBOOL(_rPropertyValue)
 ? PcrRes(RID_RSC_ENUM_SHOWHIDE[1])
 : PcrRes(RID_RSC_ENUM_SHOWHIDE[0]);
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 04c997564405..a7fcb4c8b3fd 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -529,7 +529,7 @@ OUString SfxDocumentTemplates::ConvertResourceString(const 
OUString& rString)
 STR_TEMPLATE_NAME30
 };
 
-assert(SAL_N_ELEMENTS(aTemplateNames) == 
SAL_N_ELEMENTS(STR_TEMPLATE_NAME));
+static_assert(SAL_N_ELEMENTS(aTemplateNames) == 
SAL_N_ELEMENTS(STR_TEMPLATE_NAME));
 
 for (size_t i = 0; i < SAL_N_ELEMENTS(STR_TEMPLATE_NAME); ++i)
 {
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index d974e9ad9484..cfaab66fa28b 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1021,7 +1021,7 @@ void FmXFormShell::GetConversionMenu_Lock(weld::Menu& 
rNewMenu)
 
 OString FmXFormShell::SlotToIdent(sal_uInt16 nSlot)
 {
-assert(SAL_N_ELEMENTS(SelObjectSlotMap) >= SAL_N_ELEMENTS(aConvertSlots));
+static_assert(SAL_N_ELEMENTS(SelObjectSlotMap) >= 
SAL_N_ELEMENTS(aConvertSlots));
 
 for (size_t i = 0; i < SAL_N_ELEMENTS(aConvertSlots); ++i)
 {
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx 
b/svx/source/tbxctrls/extrusioncontrols.cxx
index f30c123a42b0..ec639f77737b 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -402,7 +402,7 @@ void ExtrusionDepthWindow::implFillStrings( FieldUnit eUnit 
)
 RID_SVXSTR_DEPTH_4_INCH
 };
 
-assert(SAL_N_ELEMENTS(aDepths) == SAL_N_ELEMENTS(aDepthsInch));
+static_assert(SAL_N_ELEMENTS(aDepths) == SAL_N_ELEMENTS(aDepthsInch));
 
 const TranslateId* pResource = IsMetric(eUnit) ? aDepths : aDepthsInch;
 
diff --git a/sw/source/uibase/utlui/initui.cxx 
b/sw/source/uibase/utlui/initui.cxx
index 740152dd89ad..4438935585b9 100644
--- a/sw/source/uibase/utlui/initui.cxx
+++ b/sw/source/uibase/utlui/initui.cxx
@@ -185,7 +185,7 @@ void ShellResource::GetAutoFormatNameLst_() const
 mxAutoFormatNameLst.emplace();
 mxAutoFormatNameLst->reserve(STR_AUTOFMTREDL_END);
 
-assert(SAL_N_ELEMENTS(RID_SHELLRES_AUTOFMTSTRS) == STR_AUTOFMTREDL_END);
+static_assert(SAL_N_ELEMENTS(RID_SHELLRES_AUTOFMTSTRS) == 
STR_AUTOFMTREDL_END);
 for (sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n)
 {
 OUString p(SwResId(RID_SHELLRES_AUTOFMTSTRS[n]));
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 

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

2021-10-11 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/browserline.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 83cadf937ff9a0fd4ca24627673d45d1bab8c914
Author: Caolán McNamara 
AuthorDate: Mon Oct 11 14:23:04 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 11 18:21:49 2021 +0200

tdf#145033 remove old focus handler so no double-connect attempt is made

doesn't hurt in this case, but we assert because it has been a fairly
common problem in the past

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

diff --git a/extensions/source/propctrlr/browserline.cxx 
b/extensions/source/propctrlr/browserline.cxx
index 8618ecffc8fe..d4770ba3e5d1 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -346,6 +346,7 @@ namespace pcr
 if (m_pBrowseButton)
 {
 m_pBrowseButton->hide();
+m_pBrowseButton->connect_focus_in(Link());
 m_pBrowseButton = nullptr;
 }
 }
@@ -354,6 +355,7 @@ namespace pcr
 if (m_pAdditionalBrowseButton)
 {
 m_pAdditionalBrowseButton->hide();
+
m_pAdditionalBrowseButton->connect_focus_in(Link());
 m_pAdditionalBrowseButton = nullptr;
 }
 }


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

2021-09-30 Thread Stephan Bergmann (via logerrit)
 extensions/source/ole/unoobjw.cxx |4 ++--
 extensions/source/scanner/scanwin.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a247d574fa32770b19875e8ca967a32a32ef0f36
Author: Stephan Bergmann 
AuthorDate: Thu Sep 30 12:43:39 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 30 15:54:35 2021 +0200

Extended loplugin:referencecasting/redundantcast (clang-cl): extensions

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

diff --git a/extensions/source/ole/unoobjw.cxx 
b/extensions/source/ole/unoobjw.cxx
index a6cd0677d6ae..21debd9f54cc 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -1502,7 +1502,7 @@ Any SAL_CALL InterfaceOleWrapper::createBridge(const Any& 
modelDepObject,
 if( pVar)
 {
 pVar->vt= VT_DISPATCH;
-pVar->pdispVal= static_cast( this);
+pVar->pdispVal= this;
 AddRef();
 
 retAny<<= reinterpret_cast< sal_uIntPtr >( pVar);
@@ -2763,7 +2763,7 @@ HRESULT InterfaceOleWrapper::InvokeGeneral( DISPID 
dispidMember, unsigned short
 if( m_defaultValueType == VT_DISPATCH)
 {
 pvarResult->vt= VT_DISPATCH;
-pvarResult->pdispVal= static_cast( this);
+pvarResult->pdispVal= this;
 AddRef();
 ret= S_OK;
 }
diff --git a/extensions/source/scanner/scanwin.cxx 
b/extensions/source/scanner/scanwin.cxx
index bfe4c3c37006..109f2944a3b5 100644
--- a/extensions/source/scanner/scanwin.cxx
+++ b/extensions/source/scanner/scanwin.cxx
@@ -342,7 +342,7 @@ bool Twain::InitializeNewShim(ScannerManager& rMgr, const 
VclPtr& x
 return false; // Have a shim for another task already!
 
 // hold reference to ScannerManager, to prevent premature death
-mxMgr.set(static_cast(mpCurMgr = ), 
css::uno::UNO_QUERY);
+mxMgr = mpCurMgr = 
 
 mpThread.set(new ShimListenerThread(xTopWindow));
 mpThread->launch();


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

2021-09-26 Thread Julien Nabet (via logerrit)
 extensions/source/update/check/updatehdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 501929557800e400c9ee07d25687ee60354d74c2
Author: Julien Nabet 
AuthorDate: Sun Sep 26 10:19:55 2021 +0200
Commit: Julien Nabet 
CommitDate: Sun Sep 26 19:27:27 2021 +0200

tdf#50421: use substVariables for remaining %PERCENT% in "Check for Updates"

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

diff --git a/extensions/source/update/check/updatehdl.cxx 
b/extensions/source/update/check/updatehdl.cxx
index 9374aec98a0b..16b94d6c9db0 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -1071,7 +1071,7 @@ void UpdateHandler::createDialog()
 {   // Text (edit) 
 uno::Sequence< beans::NamedValue > aProps
 {
-{ "Text", uno::Any( msPercent ) },
+{ "Text", uno::Any( substVariables(msPercent) ) },
 { "Border", uno::Any( sal_Int16( 0 ) ) },
 { "PaintTransparent", uno::Any( true ) },
 { "ReadOnly", uno::Any( true ) },


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

2021-09-22 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/download.cxx |9 +
 extensions/source/update/check/download.hxx |6 +-
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 310d43b9a27efc36f2c9e6737a0b5ac3f211bda0
Author: Stephan Bergmann 
AuthorDate: Wed Sep 22 23:25:49 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Sep 23 07:26:38 2021 +0200

Extend loplugin:stringviewparam to starts/endsWith: extensions

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

diff --git a/extensions/source/update/check/download.cxx 
b/extensions/source/update/check/download.cxx
index 1f98b7717be2..905d16e99a7f 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -23,6 +23,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -168,7 +169,7 @@ progress_callback( void *clientp, double dltotal, double 
dlnow, SAL_UNUSED_PARAM
 
 
 void
-Download::getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& 
rPort) const
+Download::getProxyForURL(std::u16string_view rURL, OString& rHost, sal_Int32& 
rPort) const
 {
 uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
 css::configuration::theDefaultProvider::get( m_xContext ) );
@@ -191,17 +192,17 @@ Download::getProxyForURL(const OUString& rURL, OString& 
rHost, sal_Int32& rPort)
 sal_Int32 nProxyType = aValue.get< sal_Int32 >();
 if( 0 != nProxyType ) // type 0 means "direct connection to the internet
 {
-if( rURL.startsWith("http:") )
+if( o3tl::starts_with(rURL, u"http:") )
 {
 rHost = getStringValue(xNameAccess, "ooInetHTTPProxyName");
 rPort = getInt32Value(xNameAccess, "ooInetHTTPProxyPort");
 }
-else if( rURL.startsWith("https:") )
+else if( o3tl::starts_with(rURL, u"https:") )
 {
 rHost = getStringValue(xNameAccess, "ooInetHTTPSProxyName");
 rPort = getInt32Value(xNameAccess, "ooInetHTTPSProxyPort");
 }
-else if( rURL.startsWith("ftp:") )
+else if( o3tl::starts_with(rURL, u"ftp:") )
 {
 rHost = getStringValue(xNameAccess, "ooInetFTPProxyName");
 rPort = getInt32Value(xNameAccess, "ooInetFTPProxyPort");
diff --git a/extensions/source/update/check/download.hxx 
b/extensions/source/update/check/download.hxx
index 2440ce4cec85..12a11ddde091 100644
--- a/extensions/source/update/check/download.hxx
+++ b/extensions/source/update/check/download.hxx
@@ -19,6 +19,10 @@
 
 #pragma once
 
+#include 
+
+#include 
+
 #include 
 
 #include 
@@ -65,7 +69,7 @@ public:
 
 protected:
 // Determines the appropriate proxy settings for the given URL. Returns 
true if a proxy should be used
-void getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& 
rPort) const;
+void getProxyForURL(std::u16string_view rURL, OString& rHost, sal_Int32& 
rPort) const;
 
 private:
 osl::Condition m_aCondition;


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

2021-09-22 Thread Caolán McNamara (via logerrit)
 extensions/source/update/check/updatecheck.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a20b266a6e2cfc46f4fd03a4955199ed16b5bce
Author: Caolán McNamara 
AuthorDate: Wed Sep 22 10:59:55 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 22 13:27:08 2021 +0200

lock older -> lock order

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

diff --git a/extensions/source/update/check/updatecheck.cxx 
b/extensions/source/update/check/updatecheck.cxx
index 99aa5f624889..b9b64a4dfb9c 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -814,7 +814,7 @@ UpdateCheck::initialize(const uno::Sequence< 
beans::NamedValue >& rValues,
 bool downloadPaused = aModel.isDownloadPaused();
 
 enableDownload(true, downloadPaused);
-// coverity[lock_order : FALSE] - incorrect report of lock 
older error with std::recursive_mutex
+// coverity[lock_order : FALSE] - incorrect report of lock 
order error with std::recursive_mutex
 setUIState(downloadPaused ? UPDATESTATE_DOWNLOAD_PAUSED : 
UPDATESTATE_DOWNLOADING);
 }
 


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

2021-08-13 Thread Miklos Vajna (via logerrit)
 extensions/source/bibliography/general.cxx |   14 ++
 sw/source/ui/index/swuiidxmrk.cxx  |8 
 2 files changed, 22 insertions(+)

New commits:
commit f966b9e8bb2b5e7e563807d16088a9f3784f01fe
Author: Miklos Vajna 
AuthorDate: Fri Aug 13 15:37:49 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 13 18:31:11 2021 +0200

bibliography, local URL: better starting directory when picking a new file

Improve the case when we have no old file, so we can't take its old
parent directory as a starting point in the file picker, opened by the
browse button.

It turns out both places that open that file picker have access to the
base URL of the current document, so can open the directory of that
instead.

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

diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index 3992f55e5ebc..08880534eea6 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -363,6 +364,19 @@ IMPL_LINK_NOARG(BibGeneralPage, BrowseHdl, weld::Button&, 
void)
 {
 aFileDlg.SetDisplayDirectory(aPath);
 }
+else
+{
+SfxObjectShell* pShell = SfxObjectShell::Current();
+OUString aBaseURL;
+if (pShell)
+{
+aBaseURL = pShell->getDocumentBaseURL();
+}
+if (!aBaseURL.isEmpty())
+{
+aFileDlg.SetDisplayDirectory(aBaseURL);
+}
+}
 
 if (aFileDlg.Execute() != ERRCODE_NONE)
 {
diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 7b0787caf5ff..fb5ae141563c 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -1810,6 +1810,14 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, BrowseHdl, 
weld::Button&, rButton, void)
 {
 aFileDlg.SetDisplayDirectory(aPath);
 }
+else
+{
+OUString aBaseURL = 
rWrtSh.GetDoc()->GetDocShell()->getDocumentBaseURL();
+if (!aBaseURL.isEmpty())
+{
+aFileDlg.SetDisplayDirectory(aBaseURL);
+}
+}
 
 if (aFileDlg.Execute() != ERRCODE_NONE)
 {


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

2021-08-13 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/standardcontrol.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit c69aadfec031535c5b6266dcb97d40225f40eb9b
Author: Caolán McNamara 
AuthorDate: Fri Aug 13 14:49:13 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 13 17:39:18 2021 +0200

pre-select todays's date if the date is empty

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

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index f03c60b2bb4f..584c66889348 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -142,7 +142,13 @@ namespace pcr
 {
 if (!rToggle.get_active())
 return;
-m_xCalendarBox->set_date(m_xEntryFormatter->GetDate());
+::Date aDate = m_xEntryFormatter->GetDate();
+if (aDate.IsEmpty())
+{
+// with an empty date preselect today in the calendar
+aDate = ::Date(::Date::SYSTEM);
+}
+m_xCalendarBox->set_date(aDate);
 }
 
 Any SAL_CALL ODateControl::getValue()


[Libreoffice-commits] core.git: extensions/source extensions/uiconfig include/svtools solenv/sanitizers svtools/source

2021-08-13 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/propcontroller.cxx  |4 -
 extensions/source/propctrlr/standardcontrol.cxx |   51 
 extensions/source/propctrlr/standardcontrol.hxx |   23 --
 extensions/uiconfig/spropctrlr/ui/datefield.ui  |   43 
 include/svtools/ctrlbox.hxx |4 +
 solenv/sanitizers/ui/modules/spropctrlr.suppr   |2 
 svtools/source/control/ctrlbox.cxx  |7 ++-
 7 files changed, 109 insertions(+), 25 deletions(-)

New commits:
commit 20bc07707949508f029da5e523fedda3cd64ccc8
Author: Caolán McNamara 
AuthorDate: Fri Jul 16 17:26:23 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 13 15:18:54 2021 +0200

tdf#143357 use a DateFormatter and a separate Calendar menubutton

similar to what we ended up with in DateControl in
svtools/source/brwbox/ebbcontrols.cxx

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

diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index d9166b64dff6..a24384459d7d 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -754,8 +754,8 @@ namespace pcr
 case PropertyControlType::DateField:
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/datefield.ui",
 m_xContext));
-auto pMenuButton = xBuilder->weld_menu_button("datefield");
-rtl::Reference pControl = new 
ODateControl(std::make_unique(std::move(pMenuButton)), 
std::move(xBuilder), bCreateReadOnly);
+auto pContainer = xBuilder->weld_container("datefield");
+rtl::Reference pControl = new 
ODateControl(std::move(pContainer), std::move(xBuilder), bCreateReadOnly);
 pControl->SetModifyHandler();
 xControl = pControl;
 break;
diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index 7cbca1c276b4..f03c60b2bb4f 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -90,34 +90,69 @@ namespace pcr
 }
 
 //= ODateControl
-ODateControl::ODateControl(std::unique_ptr xWidget, 
std::unique_ptr xBuilder, bool bReadOnly)
+ODateControl::ODateControl(std::unique_ptr xWidget, 
std::unique_ptr xBuilder, bool bReadOnly)
 : ODateControl_Base(PropertyControlType::DateField, 
std::move(xBuilder), std::move(xWidget), bReadOnly)
+, m_xEntry(m_xBuilder->weld_entry("entry"))
+, 
m_xCalendarBox(std::make_unique(m_xBuilder->weld_menu_button("button"),
 false))
+{
+m_xEntryFormatter.reset(new weld::DateFormatter(*m_xEntry));
+
+m_xEntryFormatter->SetStrictFormat(true);
+m_xEntryFormatter->SetMin(::Date(1, 1, 1600));
+m_xEntryFormatter->SetMax(::Date(1, 1, ));
+
+
m_xEntryFormatter->SetExtDateFormat(ExtDateFieldFormat::SystemShort);
+m_xEntryFormatter->EnableEmptyField(true);
+
+m_xCalendarBox->connect_activated(LINK(this, ODateControl, 
ActivateHdl));
+
+m_xCalendarBox->get_button().connect_toggled(LINK(this, ODateControl, 
ToggleHdl));
+}
+
+void SAL_CALL ODateControl::disposing()
 {
+m_xEntryFormatter.reset();
+m_xEntry.reset();
+m_xCalendarBox.reset();
+ODateControl_Base::disposing();
 }
 
 void SAL_CALL ODateControl::setValue( const Any& _rValue )
 {
-SvtCalendarBox* pCalendarBox = getTypedControlWindow();
-
 util::Date aUNODate;
 if ( !( _rValue >>= aUNODate ) )
 {
-pCalendarBox->set_date(::Date(::Date::SYSTEM));
-pCalendarBox->set_label("");
+m_xEntry->set_text(OUString());
 }
 else
 {
 ::Date aDate( aUNODate.Day, aUNODate.Month, aUNODate.Year );
-pCalendarBox->set_date(aDate);
+m_xEntryFormatter->SetDate(aDate);
 }
 }
 
+IMPL_LINK_NOARG(ODateControl, ActivateHdl, SvtCalendarBox&, void)
+{
+m_xEntryFormatter->SetDate(m_xCalendarBox->get_date());
+setModified();
+m_xEntry->grab_focus();
+}
+
+IMPL_LINK(ODateControl, ToggleHdl, weld::Toggleable&, rToggle, void)
+{
+if (!rToggle.get_active())
+return;
+m_xCalendarBox->set_date(m_xEntryFormatter->GetDate());
+}
+
 Any SAL_CALL ODateControl::getValue()
 {
 Any aPropValue;
-::Date aDate(getTypedControlWindow()->get_date());
-if (!aDate.IsEmpty())
+if (!m_xEntry->get_text().isEmpty())
+{
+::Date aDate(m_xEntryFormatter->GetDate());
 aPropValue <<= aDate.GetUNODate();
+}
 

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

2021-08-10 Thread Caolán McNamara (via logerrit)
 extensions/source/scanner/grid.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 6f151d719ad0b4f0ee6e7a460f6b4af212df3bb2
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 16:27:10 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 10 18:30:38 2021 +0200

use rtl::math::expm1 instead of boost::math::expm1

similar to:

commit 1a1dbff33db8a6f2f55a5d92483a03670a610f6a
Date:   Mon Feb 13 18:22:28 2017 +0100

get rid of boost::math::log1p() and use rtl::math::log1p()

... which in turn uses the compiler's std::log1p()

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

diff --git a/extensions/source/scanner/grid.cxx 
b/extensions/source/scanner/grid.cxx
index 38046f67b7d2..536ead40b069 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -19,9 +19,8 @@
 
 #include 
 #include 
+#include 
 #include 
-#include 
-#include 
 
 #include 
 #include 
@@ -650,7 +649,7 @@ void GridWindow::ChangeMode(ResetType nType)
 {
 for( int i = 0; i < m_nValues; i++ )
 {
-m_pNewYValues[ i ] = m_fMinY + 
(m_fMaxY-m_fMinY)*(boost::math::expm1((m_pXValues[i]-m_fMinX)/(m_fMaxX-m_fMinX)))/(M_E-1.0);
+m_pNewYValues[ i ] = m_fMinY + 
(m_fMaxY-m_fMinY)*(rtl::math::expm1((m_pXValues[i]-m_fMinX)/(m_fMaxX-m_fMinX)))/(M_E-1.0);
 }
 }
 break;


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

2021-08-10 Thread Noel Grandin (via logerrit)
 extensions/source/propctrlr/eformshelper.cxx|   12 ++--
 extensions/source/propctrlr/propertyhandler.cxx |   12 ++--
 include/comphelper/listenernotification.hxx |5 ++---
 3 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit c23730471c487b8f01eddfa3845b49316c0db94d
Author: Noel Grandin 
AuthorDate: Mon Aug 9 17:52:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 10 17:11:55 2021 +0200

can return OInterfaceIteratorHelper2 by value here

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

diff --git a/extensions/source/propctrlr/eformshelper.cxx 
b/extensions/source/propctrlr/eformshelper.cxx
index 94f8e7a4b969..36f5f2a2b44d 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -241,10 +241,10 @@ namespace pcr
 {
 if ( !_bDoListen )
 {
-std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > 
pListenerIterator = m_aPropertyListeners.createIterator();
-while ( pListenerIterator->hasMoreElements() )
+::comphelper::OInterfaceIteratorHelper2 aListenerIterator = 
m_aPropertyListeners.createIterator();
+while ( aListenerIterator.hasMoreElements() )
 {
-PropertyEventTranslation* pTranslator = dynamic_cast< 
PropertyEventTranslation* >( pListenerIterator->next() );
+PropertyEventTranslation* pTranslator = dynamic_cast< 
PropertyEventTranslation* >( aListenerIterator.next() );
 OSL_ENSURE( pTranslator, 
"EFormsHelper::impl_toggleBindingPropertyListening_throw: invalid listener 
element in my container!" );
 if ( !pTranslator )
 continue;
@@ -275,10 +275,10 @@ namespace pcr
 }
 else
 {
-std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > 
pListenerIterator = m_aPropertyListeners.createIterator();
-while ( pListenerIterator->hasMoreElements() )
+::comphelper::OInterfaceIteratorHelper2 aListenerIterator = 
m_aPropertyListeners.createIterator();
+while ( aListenerIterator.hasMoreElements() )
 {
-Reference< XPropertyChangeListener > xListener( 
pListenerIterator->next(), UNO_QUERY );
+Reference< XPropertyChangeListener > xListener( 
aListenerIterator.next(), UNO_QUERY );
 impl_switchBindingListening_throw( true, xListener );
 }
 }
diff --git a/extensions/source/propctrlr/propertyhandler.cxx 
b/extensions/source/propctrlr/propertyhandler.cxx
index c47f4e88..a1817393324f 100644
--- a/extensions/source/propctrlr/propertyhandler.cxx
+++ b/extensions/source/propctrlr/propertyhandler.cxx
@@ -79,10 +79,10 @@ namespace pcr
 return;
 
 // remove all old property change listeners
-std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > 
removeListener = m_aPropertyListeners.createIterator();
-std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > 
readdListener = m_aPropertyListeners.createIterator();  // will copy the 
container as needed
-while ( removeListener->hasMoreElements() )
-removePropertyChangeListener( static_cast< 
XPropertyChangeListener* >( removeListener->next() ) );
+::comphelper::OInterfaceIteratorHelper2 removeListener = 
m_aPropertyListeners.createIterator();
+::comphelper::OInterfaceIteratorHelper2 readdListener = 
m_aPropertyListeners.createIterator();  // will copy the container as needed
+while ( removeListener.hasMoreElements() )
+removePropertyChangeListener( static_cast< 
XPropertyChangeListener* >( removeListener.next() ) );
 OSL_ENSURE( m_aPropertyListeners.empty(), "PropertyHandler::inspect: 
derived classes are expected to forward the removePropertyChangeListener call 
to their base class (me)!" );
 
 // remember the new component, and give derived classes the chance to 
react on it
@@ -90,8 +90,8 @@ namespace pcr
 onNewComponent();
 
 // add the listeners, again
-while ( readdListener->hasMoreElements() )
-addPropertyChangeListener( static_cast< XPropertyChangeListener* 
>( readdListener->next() ) );
+while ( readdListener.hasMoreElements() )
+addPropertyChangeListener( static_cast< XPropertyChangeListener* 
>( readdListener.next() ) );
 }
 
 void PropertyHandler::onNewComponent()
diff --git a/include/comphelper/listenernotification.hxx 
b/include/comphelper/listenernotification.hxx
index 688571304938..15f1ca64b980 100644
--- a/include/comphelper/listenernotification.hxx
+++ b/include/comphelper/listenernotification.hxx
@@ -79,10 +79,9 @@ namespace comphelper
 
 /** creates an iterator for 

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

2021-08-05 Thread Noel Grandin (via logerrit)
 extensions/source/update/check/updatehdl.cxx |4 ++--
 extensions/source/update/check/updatehdl.hxx |3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit c376b2428718a48ce4283fe002c0d493bfe1232e
Author: Noel Grandin 
AuthorDate: Thu Aug 5 10:20:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 5 12:18:18 2021 +0200

fix --enable-online-update after

commit 14cfff500e93f0d6cbf8412065feea85c01ea81d
Pass context and resource string down to boost::locale separately

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

diff --git a/extensions/source/update/check/updatehdl.cxx 
b/extensions/source/update/check/updatehdl.cxx
index 2f54e60dfd32..9374aec98a0b 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -585,7 +585,7 @@ void UpdateHandler::updateState( UpdateState eState )
 }
 
 OUString UpdateHandler::loadString(const std::locale& rLocale,
-   const char* pResourceId)
+   TranslateId pResourceId)
 {
 return Translate::get(pResourceId, rLocale);
 }
@@ -642,7 +642,7 @@ void UpdateHandler::loadStrings()
 msResumeBtn = loadString( loc, RID_UPDATE_BTN_RESUME );
 msCancelBtn = loadString( loc, RID_UPDATE_BTN_CANCEL );
 
-std::pair RID_UPDATE_BUBBLE[] =
+std::pair RID_UPDATE_BUBBLE[] =
 {
 { RID_UPDATE_BUBBLE_UPDATE_AVAIL, RID_UPDATE_BUBBLE_T_UPDATE_AVAIL },
 { RID_UPDATE_BUBBLE_UPDATE_NO_DOWN, RID_UPDATE_BUBBLE_T_UPDATE_NO_DOWN 
},
diff --git a/extensions/source/update/check/updatehdl.hxx 
b/extensions/source/update/check/updatehdl.hxx
index 12ed917a76b4..6597176468bd 100644
--- a/extensions/source/update/check/updatehdl.hxx
+++ b/extensions/source/update/check/updatehdl.hxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "actionlistener.hxx"
@@ -142,7 +143,7 @@ private:
 voidsetDownloadBtnLabel( bool bAppendDots );
 voidloadStrings();
 static OUString loadString(const std::locale& rLocale,
-   const char* pResourceId);
+   TranslateId pResourceId);
 OUStringsubstVariables( const OUString  ) const;
 static void insertControlModel( css::uno::Reference< 
css::awt::XControlModel > const & rxDialogModel,
 OUString const & rServiceName,


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

2021-08-02 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/updatecheckconfig.cxx |   34 +--
 1 file changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 0f3497ea6080df72d479a405886316da21e35885
Author: Stephan Bergmann 
AuthorDate: Mon Aug 2 16:07:00 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Aug 2 17:07:12 2021 +0200

Fix --enable-online-update build

...after 1597cc5b3e07dd24cb4cb10b35b1e93545e4b929 "convert #defines to
OUStringLiteral" (partially reverting that commit),

> extensions/source/update/check/updatecheckconfig.cxx:68:17: error: 
expected '}'
> RELEASE_NOTE"1",
> ^
> extensions/source/update/check/updatecheckconfig.cxx:62:47: note: to 
match this '{'
> const char * const aUpdateEntryProperties[] = {
>   ^

etc.

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

diff --git a/extensions/source/update/check/updatecheckconfig.cxx 
b/extensions/source/update/check/updatecheckconfig.cxx
index 8e3c5b6dc9e9..65c3e800702a 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -41,23 +41,23 @@ namespace lang = com::sun::star::lang ;
 namespace util = com::sun::star::util ;
 namespace uno = com::sun::star::uno ;
 
-constexpr OUStringLiteral LAST_CHECK = u"LastCheck";
-constexpr OUStringLiteral UPDATE_VERSION = u"UpdateVersion";
-constexpr OUStringLiteral UPDATE_BUILDID = u"UpdateBuildId";
-constexpr OUStringLiteral UPDATE_DESCRIPTION = u"UpdateDescription";
-constexpr OUStringLiteral DOWNLOAD_URL = u"DownloadURL";
-constexpr OUStringLiteral IS_DIRECT_DOWNLOAD = u"IsDirectDownload";
-constexpr OUStringLiteral OLD_VERSION = u"UpdateFoundFor";
-constexpr OUStringLiteral AUTOCHECK_ENABLED = u"AutoCheckEnabled";
-constexpr OUStringLiteral AUTODOWNLOAD_ENABLED = u"AutoDownloadEnabled";
-constexpr OUStringLiteral CHECK_INTERVAL = u"CheckInterval";
-constexpr OUStringLiteral LOCAL_FILE = u"LocalFile";
-constexpr OUStringLiteral DOWNLOAD_SIZE = u"DownloadSize";
-constexpr OUStringLiteral DOWNLOAD_PAUSED = u"DownloadPaused";
-constexpr OUStringLiteral DOWNLOAD_DESTINATION = u"DownloadDestination";
-constexpr OUStringLiteral RELEASE_NOTE = u"ReleaseNote";
-
-constexpr OUStringLiteral PROPERTY_VERSION = u"Version";
+#define LAST_CHECK  "LastCheck"
+#define UPDATE_VERSION  "UpdateVersion"
+#define UPDATE_BUILDID  "UpdateBuildId"
+#define UPDATE_DESCRIPTION  "UpdateDescription"
+#define DOWNLOAD_URL"DownloadURL"
+#define IS_DIRECT_DOWNLOAD  "IsDirectDownload"
+#define OLD_VERSION "UpdateFoundFor"
+#define AUTOCHECK_ENABLED   "AutoCheckEnabled"
+#define AUTODOWNLOAD_ENABLED"AutoDownloadEnabled"
+#define CHECK_INTERVAL  "CheckInterval"
+#define LOCAL_FILE  "LocalFile"
+#define DOWNLOAD_SIZE   "DownloadSize"
+#define DOWNLOAD_PAUSED "DownloadPaused"
+#define DOWNLOAD_DESTINATION"DownloadDestination"
+#define RELEASE_NOTE"ReleaseNote"
+
+#define PROPERTY_VERSION"Version"
 
 const char * const aUpdateEntryProperties[] = {
 UPDATE_VERSION,


[Libreoffice-commits] core.git: extensions/source extensions/uiconfig officecfg/registry

2021-07-27 Thread Miklos Vajna (via logerrit)
 extensions/source/bibliography/datman.cxx|3 +
 extensions/uiconfig/sbibliography/ui/mappingdialog.ui|   24 ++-
 officecfg/registry/data/org/openoffice/Office/DataAccess.xcu |8 +++
 3 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit d422512a5c9afc3b309442ba1cbd4405afab96c8
Author: Miklos Vajna 
AuthorDate: Tue Jul 27 14:55:15 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jul 27 16:18:15 2021 +0200

sw bibliography, local copy: handle the column mapping dialog

This allows mapping the LocalURL database column to the LocalURL
property of a bibliography reference field.

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

diff --git a/extensions/source/bibliography/datman.cxx 
b/extensions/source/bibliography/datman.cxx
index 875938b7924f..e53d2b0392b9 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -219,6 +219,7 @@ class MappingDialog_Impl : public 
weld::GenericDialogController
 std::unique_ptr m_xCustom3LB;
 std::unique_ptr m_xCustom4LB;
 std::unique_ptr m_xCustom5LB;
+std::unique_ptr m_xLocalURLLB;
 weld::ComboBox* aListBoxes[COLUMN_COUNT];
 
 DECL_LINK(OkHdl, weld::Button&, void);
@@ -278,6 +279,7 @@ MappingDialog_Impl::MappingDialog_Impl(weld::Window* 
pParent, BibDataManager* pM
 , m_xCustom3LB(m_xBuilder->weld_combo_box("custom3Combobox"))
 , m_xCustom4LB(m_xBuilder->weld_combo_box("custom4Combobox"))
 , m_xCustom5LB(m_xBuilder->weld_combo_box("custom5Combobox"))
+, m_xLocalURLLB(m_xBuilder->weld_combo_box("LocalURLCombobox"))
 {
 m_xOKBT->connect_clicked(LINK(this, MappingDialog_Impl, OkHdl));
 OUString sTitle = m_xDialog->get_title();
@@ -315,6 +317,7 @@ MappingDialog_Impl::MappingDialog_Impl(weld::Window* 
pParent, BibDataManager* pM
 aListBoxes[28] = m_xCustom3LB.get();
 aListBoxes[29] = m_xCustom4LB.get();
 aListBoxes[30] = m_xCustom5LB.get();
+aListBoxes[31] = m_xLocalURLLB.get();
 
 aListBoxes[0]->append_text(sNone);
 Reference< XNameAccess >  xFields = getColumns( pDatMan->getForm() );
diff --git a/extensions/uiconfig/sbibliography/ui/mappingdialog.ui 
b/extensions/uiconfig/sbibliography/ui/mappingdialog.ui
index 2dca5ddf11e0..b4053eeb7741 100644
--- a/extensions/uiconfig/sbibliography/ui/mappingdialog.ui
+++ b/extensions/uiconfig/sbibliography/ui/mappingdialog.ui
@@ -948,10 +948,30 @@
   
 
 
-  
+  
+True
+False
+end
+Local copy
+True
+LocalURLCombobox
+  
+  
+4
+14
+  
 
 
-  
+  
+True
+False
+center
+True
+  
+  
+5
+14
+  
 
 
   
diff --git a/officecfg/registry/data/org/openoffice/Office/DataAccess.xcu 
b/officecfg/registry/data/org/openoffice/Office/DataAccess.xcu
index edba2a2020be..22aabb743d21 100644
--- a/officecfg/registry/data/org/openoffice/Office/DataAccess.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/DataAccess.xcu
@@ -437,6 +437,14 @@
   Custom5
 
   
+  
+
+  LocalURL
+
+
+  LocalURL
+
+  
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: extensions/source i18npool/source lingucomponent/source shell/qa solenv/gcc-wrappers vcl/workben

2021-07-23 Thread Collabora (via logerrit)
 extensions/source/ole/ole2uno.hxx|1 
 extensions/source/ole/oleobjw.hxx|3 --
 extensions/source/ole/servprov.hxx   |3 --
 extensions/source/ole/unoobjw.hxx|3 --
 i18npool/source/localedata/LocaleNode.cxx|1 
 i18npool/source/localedata/LocaleNode.hxx|1 
 lingucomponent/source/languageguessing/guess.hxx |   10 +++-
 lingucomponent/source/languageguessing/guesslang.cxx |1 
 lingucomponent/source/languageguessing/simpleguesser.hxx |   18 ++-
 shell/qa/zip/testzipimpl.cxx |4 +--
 shell/qa/zip/testzipimpl.hxx |4 ---
 solenv/gcc-wrappers/g++.cxx  |2 +
 solenv/gcc-wrappers/gcc.cxx  |2 +
 solenv/gcc-wrappers/wrapper.cxx  |2 +
 solenv/gcc-wrappers/wrapper.hxx  |8 ++
 vcl/workben/win/dnd/transferable.hxx |1 
 16 files changed, 29 insertions(+), 35 deletions(-)

New commits:
commit 2d04d7cc559445d8c1559af6af6d981d9f682db4
Author: Collabora 
AuthorDate: Thu Jul 15 12:18:49 2021 +0200
Commit: Luboš Luňák 
CommitDate: Fri Jul 23 10:32:08 2021 +0200

do not use "using namespace std" in headers

It's a bad style, doing that in headers can affect many source files
(especially with PCH used).

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

diff --git a/extensions/source/ole/ole2uno.hxx 
b/extensions/source/ole/ole2uno.hxx
index ca166415fa74..5fcf2fd96ad8 100644
--- a/extensions/source/ole/ole2uno.hxx
+++ b/extensions/source/ole/ole2uno.hxx
@@ -45,7 +45,6 @@ using namespace com::sun::star::registry;
 using namespace com::sun::star::reflection;
 using namespace com::sun::star::beans;
 using namespace osl;
-using namespace std;
 
 VARTYPE getVarType(const Any& val);
 /* creates a Type object for a given type name.
diff --git a/extensions/source/ole/oleobjw.hxx 
b/extensions/source/ole/oleobjw.hxx
index 97ba2f0be8f0..d1a1d0ed81fc 100644
--- a/extensions/source/ole/oleobjw.hxx
+++ b/extensions/source/ole/oleobjw.hxx
@@ -41,12 +41,11 @@
 #include "unoconversionutilities.hxx"
 #include "windata.hxx"
 using namespace cppu;
-using namespace std;
 using namespace com::sun::star::lang;
 using namespace com::sun::star::bridge;
 using namespace com::sun::star::bridge::oleautomation;
 
-typedef std::unordered_map> DispIdMap;
+typedef std::unordered_map> 
DispIdMap;
 
 typedef std::unordered_multimap TLBFuncIndexMap;
 
diff --git a/extensions/source/ole/servprov.hxx 
b/extensions/source/ole/servprov.hxx
index 6b9275da17ad..8871f28cf7a0 100644
--- a/extensions/source/ole/servprov.hxx
+++ b/extensions/source/ole/servprov.hxx
@@ -30,7 +30,6 @@
 
 using namespace com::sun::star::bridge;
 using namespace cppu;
-using namespace std;
 
 /// @throws Exception
 Reference< XInterface> ConverterProvider_CreateInstance2(  const 
Reference & xSMgr);
@@ -176,7 +175,7 @@ public:
 protected:
 bool provideInstance(std::function()> 
xInstFunction, GUID const * guid);
 
-list< OneInstanceOleWrapper* > m_wrapperList;
+std::list< OneInstanceOleWrapper* > m_wrapperList;
 Reference< XBridgeSupplier2 >   m_bridgeSupplier;
 
 Reference m_smgr;
diff --git a/extensions/source/ole/unoobjw.hxx 
b/extensions/source/ole/unoobjw.hxx
index 9b3c6b6b751c..845724d819ae 100644
--- a/extensions/source/ole/unoobjw.hxx
+++ b/extensions/source/ole/unoobjw.hxx
@@ -40,7 +40,6 @@
 #define DISPID_GET_STRUCT_FUNC  -102
 #define DISPID_CREATE_TYPE_FUNC -103
 
-using namespace std;
 using namespace cppu;
 using namespace com::sun::star::bridge;
 using namespace com::sun::star::script;
@@ -196,7 +195,7 @@ protected:
 Reference   m_xExactName;
 Reference   m_xOrigin;
 NameToIdMap m_nameToDispIdMap;
-vector  m_MemberInfos;
+std::vector  m_MemberInfos;
 // This member is used to determine the default value
 // denoted by DISPID_VALUE (0). For proper results in JavaScript
 // we have to return the default value when we write an object
diff --git a/i18npool/source/localedata/LocaleNode.cxx 
b/i18npool/source/localedata/LocaleNode.cxx
index 942e03271029..0ae5978a75f5 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -41,6 +41,7 @@ typedef ::o3tl::sorted_vector< OUString > NameSet;
 typedef ::o3tl::sorted_vector< sal_Int16 > ValueSet;
 
 namespace cssi = ::com::sun::star::i18n;
+using namespace std;
 
 LocaleNode::LocaleNode (const OUString& name, const Reference< XAttributeList 
> & attr)
 : aName(name)
diff --git a/i18npool/source/localedata/LocaleNode.hxx 

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

2021-07-17 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/standardcontrol.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit ecf901685ac0c6c7b27b81096bea96cdc3d2c2ca
Author: Caolán McNamara 
AuthorDate: Fri Jul 16 15:53:00 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Jul 17 21:17:03 2021 +0200

Related: tdf#143357 set blank label for no date

instead of current system date

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

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index 2307d0bf01f4..7cbca1c276b4 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -97,15 +97,18 @@ namespace pcr
 
 void SAL_CALL ODateControl::setValue( const Any& _rValue )
 {
+SvtCalendarBox* pCalendarBox = getTypedControlWindow();
+
 util::Date aUNODate;
 if ( !( _rValue >>= aUNODate ) )
 {
-getTypedControlWindow()->set_date(::Date(::Date::SYSTEM));
+pCalendarBox->set_date(::Date(::Date::SYSTEM));
+pCalendarBox->set_label("");
 }
 else
 {
 ::Date aDate( aUNODate.Day, aUNODate.Month, aUNODate.Year );
-getTypedControlWindow()->set_date(aDate);
+pCalendarBox->set_date(aDate);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Miklos Vajna (via logerrit)
 extensions/source/bibliography/general.cxx  |  143 ++--
 extensions/source/bibliography/general.hxx  |8 +
 extensions/uiconfig/sbibliography/ui/generalpage.ui |   81 +--
 3 files changed, 214 insertions(+), 18 deletions(-)

New commits:
commit 1e2420e7add9ca78e5f4de095dac2cef5c0f5940
Author: Miklos Vajna 
AuthorDate: Fri Jul 16 12:27:44 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Jul 16 14:45:23 2021 +0200

extensions: bibliography database window: add UI to set a page number on a 
URL

Again, to be consistent with the Define Bibliography Entry dialog which
already had this.

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

diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index 07fda81fc69f..329ed9391bf9 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -51,6 +52,65 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::form;
 using namespace ::com::sun::star::sdb;
 
+namespace
+{
+/// Tries to split rText into rURL and nPageNumber.
+bool SplitUrlAndPage(const OUString& rText, OUString& rUrl, int& nPageNumber)
+{
+uno::Reference xUriReferenceFactory
+= 
uri::UriReferenceFactory::create(comphelper::getProcessComponentContext());
+uno::Reference xUriRef;
+try
+{
+xUriRef = xUriReferenceFactory->parse(rText);
+}
+catch (const uno::Exception& rException)
+{
+SAL_WARN("extensions.biblio",
+ "SplitUrlAndPage: failed to parse url: " << 
rException.Message);
+return false;
+}
+
+OUString aPagePrefix("page=");
+if (!xUriRef->getFragment().startsWith(aPagePrefix))
+{
+return false;
+}
+
+nPageNumber = 
xUriRef->getFragment().copy(aPagePrefix.getLength()).toInt32();
+xUriRef->clearFragment();
+rUrl = xUriRef->getUriReference();
+return true;
+}
+
+/// Merges rUrl and rPageSB to a URL string.
+OUString MergeUrlAndPage(const OUString& rUrl, weld::SpinButton& rPageSB)
+{
+if (!rPageSB.get_sensitive())
+{
+return rUrl;
+}
+
+uno::Reference xUriReferenceFactory
+= 
uri::UriReferenceFactory::create(comphelper::getProcessComponentContext());
+uno::Reference xUriRef;
+try
+{
+xUriRef = xUriReferenceFactory->parse(rUrl);
+}
+catch (const uno::Exception& rException)
+{
+SAL_WARN("extensions.biblio",
+ "MergeUrlAndPage: failed to parse url: " << 
rException.Message);
+return rUrl;
+}
+
+OUString aFragment("page=" + OUString::number(rPageSB.get_value()));
+xUriRef->setFragment(aFragment);
+return xUriRef->getUriReference();
+}
+}
+
 static OUString lcl_GetColumnName( const Mapping* pMapping, sal_uInt16 
nIndexPos )
 {
 BibConfig* pBibConfig = BibModul::GetConfig();
@@ -125,6 +185,8 @@ BibGeneralPage::BibGeneralPage(vcl::Window* pParent, 
BibDataManager* pMan)
 , xURLFT(m_xBuilder->weld_label("url"))
 , xURLED(m_xBuilder->weld_entry("urlcontrol"))
 , m_xBrowseButton(m_xBuilder->weld_button("browse"))
+, m_xPageCB(m_xBuilder->weld_check_button("pagecb"))
+, m_xPageSB(m_xBuilder->weld_spin_button("pagesb"))
 , xCustom1FT(m_xBuilder->weld_label("custom1"))
 , xCustom1ED(m_xBuilder->weld_entry("custom1control"))
 , xCustom2FT(m_xBuilder->weld_label("custom2"))
@@ -402,12 +464,11 @@ public:
 WriteBack();
 }
 
+virtual void WriteBack() = 0;
+
 protected:
 css::uno::Reference m_xPropSet;
 bool m_bSelfChanging;
-
-private:
-virtual void WriteBack() = 0;
 };
 
 namespace
@@ -415,9 +476,11 @@ namespace
 class EntryChangeListener : public ChangeListener
 {
 public:
-explicit EntryChangeListener(weld::Entry& rEntry, 
css::uno::Reference& rPropSet)
+explicit EntryChangeListener(weld::Entry& rEntry, 
css::uno::Reference& rPropSet,
+ BibGeneralPage& rPage)
 : ChangeListener(rPropSet)
 , m_rEntry(rEntry)
+, m_rPage(rPage)
 {
 rEntry.connect_focus_out(LINK(this, EntryChangeListener, 
LoseFocusHdl));
 setValue(rPropSet->getPropertyValue("Text"));
@@ -443,24 +506,66 @@ namespace
 
 private:
 weld::Entry& m_rEntry;
+BibGeneralPage& m_rPage;
 
 DECL_LINK(LoseFocusHdl, weld::Widget&, void);
 
+/// Updates the UI widget(s) based on rValue.
 void setValue(const css::uno::Any& rValue)
 {
 OUString sNewName;
 rValue >>= sNewName;
-m_rEntry.set_text(sNewName);
+if (_rEntry != _rPage.GetURLED())
+{
+

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

2021-06-25 Thread Stephan Bergmann (via logerrit)
 extensions/source/ole/oleobjw.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5caba6ebf48e1ffe3f281055ae2aff5234bd594e
Author: Stephan Bergmann 
AuthorDate: Fri Jun 25 10:05:52 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 25 17:16:40 2021 +0200

Add back computation of excepinfo.bstrDescription length

...which had been dropped with eebd84b337506c8fff151493f9b51bd127dbc89f
"loplugin:stringview (clang-cl)".  But as discussed in the comments at


"loplugin:stringview (clang-cl)", that dropped support for embedded NULs 
("not
that this should matter here", though).

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

diff --git a/extensions/source/ole/oleobjw.cxx 
b/extensions/source/ole/oleobjw.cxx
index b9123a031ee8..0cc08f94d535 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -26,6 +26,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1428,7 +1429,8 @@ uno::Any SAL_CALL IUnknownWrapper::directInvoke( const 
OUString& aName, const un
 break;
 case DISP_E_EXCEPTION:
 message = OUString::Concat("[automation bridge]: ")
-+ o3tl::toU(excepinfo.bstrDescription);
++ 
std::u16string_view(o3tl::toU(excepinfo.bstrDescription),
+::SysStringLen(excepinfo.bstrDescription));
 throw InvocationTargetException(message, 
Reference(), Any());
 break;
 case DISP_E_MEMBERNOTFOUND:
@@ -2049,7 +2051,8 @@ Any  IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& 
aFuncDesc,
 break;
 case DISP_E_EXCEPTION:
 message = OUString::Concat("[automation bridge]: ")
-+ o3tl::toU(excepinfo.bstrDescription);
++ std::u16string_view(o3tl::toU(excepinfo.bstrDescription),
+::SysStringLen(excepinfo.bstrDescription));
 
 throw InvocationTargetException(message, 
Reference(), Any());
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-25 Thread Stephan Bergmann (via logerrit)
 extensions/source/ole/servprov.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit c97eba19ebf8e94da290869f429316f80d2b21b7
Author: Stephan Bergmann 
AuthorDate: Fri Jun 25 10:41:27 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 25 15:31:28 2021 +0200

-Werror,-Wunused-but-set-parameter (clang-cl 13 trunk)

...ever since 95117e7fefa9ae82431dcdffd1e58495730f6f54 "initial import"

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

diff --git a/extensions/source/ole/servprov.cxx 
b/extensions/source/ole/servprov.cxx
index 8fc03c256d96..ea69be1d9fe2 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -137,7 +137,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP_(ULONG) 
OneInstanceOleWrapper::Release()
 return refCount;
 }
 
-COM_DECLSPEC_NOTHROW STDMETHODIMP 
OneInstanceOleWrapper::CreateInstance(IUnknown* punkOuter,
+COM_DECLSPEC_NOTHROW STDMETHODIMP 
OneInstanceOleWrapper::CreateInstance(IUnknown*,
 REFIID 
riid, void** ppv)
 {
 comphelper::Automation::AutomationInvokedZone aAutomationActive;
@@ -145,7 +145,6 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
OneInstanceOleWrapper::CreateInstance(IUnknown
 SAL_INFO("extensions.olebridge", "OneInstanceOleWrapper::CreateInstance(" 
<< riid << ")");
 
 HRESULT ret = ResultFromScode(E_UNEXPECTED);
-punkOuter = nullptr;
 
 const Reference& xInst = m_xInstFunction();
 if (xInst.is())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-25 Thread Stephan Bergmann (via logerrit)
 extensions/source/ole/unoconversionutilities.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 8d588425ea03cfdc93ba0028377354b23060b47f
Author: Stephan Bergmann 
AuthorDate: Fri Jun 25 10:44:48 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 25 14:27:08 2021 +0200

-Werror,-Wunused-but-set-variable (clang-cl 13 trunk)

...ever since 95117e7fefa9ae82431dcdffd1e58495730f6f54 "initial import"

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

diff --git a/extensions/source/ole/unoconversionutilities.hxx 
b/extensions/source/ole/unoconversionutilities.hxx
index 57ded2ce696c..338d85b622da 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -2108,7 +2108,6 @@ template
 Sequence UnoConversionUtilities::createOleArrayWrapperOfDim(SAFEARRAY* 
pArray,
   unsigned int dimCount, unsigned int actDim, LONG* index, VARTYPE 
type, const Type& unotype)
 {
-HRESULT hr= S_OK;
 LONG lBound;
 LONG uBound;
 LONG nCountElements;
@@ -2158,7 +2157,7 @@ Sequence 
UnoConversionUtilities::createOleArrayWrapperOfDim(SAFEARRAY* p
 SafeArrayGetElement(pArray, index, _DATE());
 break;
 case VT_BSTR:
-hr= SafeArrayGetElement(pArray, index, _BSTR());
+SafeArrayGetElement(pArray, index, _BSTR());
 break;
 case VT_DISPATCH:
 SafeArrayGetElement(pArray, index, _DISPATCH());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: extensions/source filter/source sc/qa sc/source sfx2/source sw/source tools/source vcl/source

2021-06-19 Thread Noel Grandin (via logerrit)
 extensions/source/scanner/sanedlg.cxx|3 +--
 filter/source/msfilter/svdfppt.cxx   |3 +--
 sc/qa/extras/scpdfexport.cxx |3 +--
 sc/source/filter/xcl97/XclImpChangeTrack.cxx |3 +--
 sfx2/source/doc/oleprops.cxx |3 +--
 sw/source/filter/ww8/ww8par4.cxx |6 ++
 tools/source/stream/stream.cxx   |6 +-
 vcl/source/treelist/transfer.cxx |6 +++---
 8 files changed, 11 insertions(+), 22 deletions(-)

New commits:
commit 7af0f1514407660a43cde90320bbe00c36c3be28
Author: Noel Grandin 
AuthorDate: Sat Jun 19 13:52:40 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jun 19 18:13:52 2021 +0200

use more TellEnd()

which has the potential to be more efficient than STREAM_SEEK_TO_END

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

diff --git a/extensions/source/scanner/sanedlg.cxx 
b/extensions/source/scanner/sanedlg.cxx
index d13ebcc53da9..87c17e56fe78 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -871,8 +871,7 @@ void SaneDlg::AcquirePreview()
 else
 {
 #if OSL_DEBUG_LEVEL > 0
-xTransporter->getStream().Seek( STREAM_SEEK_TO_END );
-SAL_INFO("extensions.scanner", "Previewbitmapstream contains " << 
xTransporter->getStream().Tell() << "bytes");
+SAL_INFO("extensions.scanner", "Previewbitmapstream contains " << 
xTransporter->getStream().TellEnd() << "bytes");
 #endif
 xTransporter->getStream().Seek( STREAM_SEEK_TO_BEGIN );
 mxPreview->SetBitmap(xTransporter->getStream());
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index bcf243b3f920..df873c2bf122 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1318,8 +1318,7 @@ SdrPowerPointImport::SdrPowerPointImport( 
PowerPointImportParam& rParam, const O
 {
 if ( m_bOk )
 {
-rStCtrl.Seek( STREAM_SEEK_TO_END );
-nStreamLen = rStCtrl.Tell();
+nStreamLen = rStCtrl.TellEnd();
 
 // try to allocate the UserEditAtom via CurrentUserAtom
 sal_uInt32 nCurrentUserEdit = rParam.aCurrentUserAtom.nCurrentUserEdit;
diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx
index b98ee774b7ee..6dfa426fddc0 100644
--- a/sc/qa/extras/scpdfexport.cxx
+++ b/sc/qa/extras/scpdfexport.cxx
@@ -138,8 +138,7 @@ bool ScPDFExportTest::hasTextInPdf(const 
std::shared_ptr& pPDFFil
 CPPUNIT_ASSERT(pStream);
 
 // get file size
-pStream->Seek(STREAM_SEEK_TO_END);
-const std::size_t nFileSize = pStream->Tell();
+const std::size_t nFileSize = pStream->TellEnd();
 if (nFileSize == 0)
 return false;
 
diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx 
b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
index e3451aca4001..74b60da2208b 100644
--- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
@@ -52,8 +52,7 @@ XclImpChangeTrack::XclImpChangeTrack( const XclImpRoot& 
rRoot, const XclImpStrea
 if( !xInStrm.is() )
 return;
 
-xInStrm->Seek( STREAM_SEEK_TO_END );
-sal_uInt64 const nStreamLen = xInStrm->Tell();
+sal_uInt64 const nStreamLen = xInStrm->TellEnd();
 if( (xInStrm->GetErrorCode() == ERRCODE_NONE) && (nStreamLen != 
STREAM_SEEK_TO_END) )
 {
 xInStrm->Seek( STREAM_SEEK_TO_BEGIN );
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index ee1927522e05..6de4aace5c99 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -1018,8 +1018,7 @@ void SfxOleSection::ImplSave( SvStream& rStrm )
 SaveProperty( rStrm, *prop.second, nPropPosPos );
 
 // write section size (first field in section header)
-rStrm.Seek( STREAM_SEEK_TO_END );
-sal_uInt32 nSectSize = static_cast< sal_uInt32 >( rStrm.Tell() - 
mnStartPos );
+sal_uInt32 nSectSize = static_cast< sal_uInt32 >( rStrm.TellEnd() - 
mnStartPos );
 rStrm.Seek( mnStartPos );
 rStrm.WriteUInt32( nSectSize );
 }
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 6c72ed5321eb..e7e559d586a4 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -84,9 +84,8 @@ static bool SwWw8ReadScaling(tools::Long& rX, tools::Long& 
rY, tools::SvRefSetEndian( SvStreamEndian::LITTLE );
-pS->Seek( STREAM_SEEK_TO_END );
 
-OSL_ENSURE( pS->Tell() >=  76, "+OLE-PIC-Stream is shorter than 76 Byte" );
+OSL_ENSURE( pS->TellEnd() >=  76, "+OLE-PIC-Stream is shorter than 76 
Byte" );
 
 sal_Int32 nOrgWidth,
   nOrgHeight,
@@ -406,9 +405,8 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
 if (bOleOk)
 {
 sal_uLong nOldPos = m_pDataStream->Tell();
-

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

2021-05-21 Thread Caolán McNamara (via logerrit)
 extensions/source/abpilot/typeselectionpage.cxx |   12 +---
 extensions/source/abpilot/typeselectionpage.hxx |2 
 extensions/source/dbpilots/commonpagesdbp.cxx   |8 +--
 extensions/source/dbpilots/commonpagesdbp.hxx   |2 
 sd/source/ui/dlg/dlgsnap.cxx|   24 ++---
 sd/source/ui/inc/dlgsnap.hxx|1 
 sw/source/ui/dbui/dbinsdlg.cxx  |   26 ++
 sw/source/ui/misc/docfnote.cxx  |   61 +---
 sw/source/ui/misc/impfnote.hxx  |3 -
 sw/source/ui/misc/insfnote.cxx  |   23 +
 sw/source/ui/table/convert.cxx  |   16 +++---
 sw/source/uibase/inc/convert.hxx|2 
 sw/source/uibase/inc/dbinsdlg.hxx   |4 -
 sw/source/uibase/inc/insfnote.hxx   |3 -
 14 files changed, 107 insertions(+), 80 deletions(-)

New commits:
commit d16ceda55b145cb31882bbf504924aa9103278aa
Author: Caolán McNamara 
AuthorDate: Thu May 20 15:36:42 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 21 10:49:40 2021 +0200

use toggle instead of click for RadioButton

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

diff --git a/extensions/source/abpilot/typeselectionpage.cxx 
b/extensions/source/abpilot/typeselectionpage.cxx
index 6e923b00aff6..29efaf4f4fe7 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -115,14 +115,14 @@ namespace abp
 m_aAllTypes.push_back( ButtonItem( m_xMacab.get(), AST_MACAB, 
bHaveMacab ) );
 m_aAllTypes.push_back( ButtonItem( m_xOther.get(), AST_OTHER, true ) );
 
-Link aTypeSelectionHandler = LINK(this, 
TypeSelectionPage, OnTypeSelected );
+Link aTypeSelectionHandler = LINK(this, 
TypeSelectionPage, OnTypeSelected );
 for (auto const& elem : m_aAllTypes)
 {
 if (!elem.m_bVisible)
 elem.m_pItem->hide();
 else
 {
-elem.m_pItem->connect_clicked( aTypeSelectionHandler );
+elem.m_pItem->connect_toggled( aTypeSelectionHandler );
 elem.m_pItem->show();
 }
 }
@@ -205,22 +205,20 @@ namespace abp
 return true;
 }
 
-
 bool TypeSelectionPage::canAdvance() const
 {
 return  AddressBookSourcePage::canAdvance()
 &&  (AST_INVALID != getSelectedType());
 }
 
-
-IMPL_LINK_NOARG( TypeSelectionPage, OnTypeSelected, weld::Button&, void )
+IMPL_LINK(TypeSelectionPage, OnTypeSelected, weld::ToggleButton&, rButton, 
void)
 {
+if (!rButton.get_active())
+return;
 getDialog()->typeSelectionChanged( getSelectedType() );
 updateDialogTravelUI();
 }
 
-
 }   // namespace abp
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/abpilot/typeselectionpage.hxx 
b/extensions/source/abpilot/typeselectionpage.hxx
index 9caaeb8e1c4e..b3878a6bf711 100644
--- a/extensions/source/abpilot/typeselectionpage.hxx
+++ b/extensions/source/abpilot/typeselectionpage.hxx
@@ -71,7 +71,7 @@ namespace abp
 // OImportPage overridables
 virtual boolcanAdvance() const override;
 
-DECL_LINK( OnTypeSelected, weld::Button&, void );
+DECL_LINK( OnTypeSelected, weld::ToggleButton&, void );
 
 voidselectType( AddressSourceType _eType );
 };
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx 
b/extensions/source/dbpilots/commonpagesdbp.cxx
index 883f1a78536c..3aede04224e4 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -362,13 +362,15 @@ namespace dbp
 m_pNo = &_rNoButton;
 m_pList = &_rSelection;
 
-m_pYes->connect_clicked(LINK(this, OMaybeListSelectionPage, 
OnRadioSelected));
-m_pNo->connect_clicked(LINK(this, OMaybeListSelectionPage, 
OnRadioSelected));
+m_pYes->connect_toggled(LINK(this, OMaybeListSelectionPage, 
OnRadioSelected));
+m_pNo->connect_toggled(LINK(this, OMaybeListSelectionPage, 
OnRadioSelected));
 implEnableWindows();
 }
 
-IMPL_LINK_NOARG( OMaybeListSelectionPage, OnRadioSelected, weld::Button&, 
void )
+IMPL_LINK(OMaybeListSelectionPage, OnRadioSelected, weld::ToggleButton&, 
rButton, void)
 {
+if (!rButton.get_active())
+return;
 implEnableWindows();
 }
 
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx 
b/extensions/source/dbpilots/commonpagesdbp.hxx
index ebb2331c5bd8..6aaac6854eab 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -70,7 +70,7 @@ namespace dbp
 virtual ~OMaybeListSelectionPage() 

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

2021-05-15 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/propertyeditor.hxx |2 +-
 include/vcl/weld.hxx   |4 ++--
 vcl/inc/salvtables.hxx |2 +-
 vcl/source/app/salvtables.cxx  |   10 +-
 vcl/unx/gtk3/gtkinst.cxx   |   20 
 5 files changed, 17 insertions(+), 21 deletions(-)

New commits:
commit 609416ca21aa2912908ef46d1129deec3cd24bae
Author: Caolán McNamara 
AuthorDate: Sat May 15 14:49:17 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 15 21:43:10 2021 +0200

inherit LinkButton and Notebook from Widget instead of Container

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

diff --git a/extensions/source/propctrlr/propertyeditor.hxx 
b/extensions/source/propctrlr/propertyeditor.hxx
index 32625f103409..5ca271d0d14a 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -99,7 +99,7 @@ namespace pcr
 
 Sizeget_preferred_size() const;
 
-weld::Container*getWidget() const { return 
m_xTabControl.get(); }
+weld::Widget*   getWidget() const { return 
m_xTabControl.get(); }
 
 voidShow() { m_xTabControl->show(); }
 voidHide() { m_xTabControl->hide(); }
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index b0801ec0ad1d..1101df6b46c4 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -457,7 +457,7 @@ public:
 virtual std::unique_ptr weld_label_widget() const = 0;
 };
 
-class VCL_DLLPUBLIC Notebook : virtual public Container
+class VCL_DLLPUBLIC Notebook : virtual public Widget
 {
 protected:
 Link m_aLeavePageHdl;
@@ -1525,7 +1525,7 @@ class VCL_DLLPUBLIC RadioButton : virtual public 
ToggleButton
 {
 };
 
-class VCL_DLLPUBLIC LinkButton : virtual public Container
+class VCL_DLLPUBLIC LinkButton : virtual public Widget
 {
 protected:
 Link m_aActivateLinkHdl;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 8b415b998b4b..a20a862d9a45 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1032,7 +1032,7 @@ public:
 virtual ~SalInstanceButton() override;
 };
 
-class SalInstanceNotebook : public SalInstanceContainer, public virtual 
weld::Notebook
+class SalInstanceNotebook : public SalInstanceWidget, public virtual 
weld::Notebook
 {
 private:
 VclPtr m_xNotebook;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 771517062a1e..20ad4154d23f 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2310,7 +2310,7 @@ IMPL_LINK_NOARG(SalInstanceScrolledWindow, HscrollHdl, 
ScrollBar*, void)
 
 SalInstanceNotebook::SalInstanceNotebook(TabControl* pNotebook, 
SalInstanceBuilder* pBuilder,
  bool bTakeOwnership)
-: SalInstanceContainer(pNotebook, pBuilder, bTakeOwnership)
+: SalInstanceWidget(pNotebook, pBuilder, bTakeOwnership)
 , m_xNotebook(pNotebook)
 {
 m_xNotebook->SetActivatePageHdl(LINK(this, SalInstanceNotebook, 
ActivatePageHdl));
@@ -2447,7 +2447,7 @@ IMPL_LINK_NOARG(SalInstanceNotebook, ActivatePageHdl, 
TabControl*, void)
 
 namespace
 {
-class SalInstanceVerticalNotebook : public SalInstanceContainer, public 
virtual weld::Notebook
+class SalInstanceVerticalNotebook : public SalInstanceWidget, public virtual 
weld::Notebook
 {
 private:
 VclPtr m_xNotebook;
@@ -2459,7 +2459,7 @@ private:
 public:
 SalInstanceVerticalNotebook(VerticalTabControl* pNotebook, 
SalInstanceBuilder* pBuilder,
 bool bTakeOwnership)
-: SalInstanceContainer(pNotebook, pBuilder, bTakeOwnership)
+: SalInstanceWidget(pNotebook, pBuilder, bTakeOwnership)
 , m_xNotebook(pNotebook)
 {
 m_xNotebook->SetActivatePageHdl(LINK(this, 
SalInstanceVerticalNotebook, ActivatePageHdl));
@@ -2835,7 +2835,7 @@ public:
 
 namespace
 {
-class SalInstanceLinkButton : public SalInstanceContainer, public virtual 
weld::LinkButton
+class SalInstanceLinkButton : public SalInstanceWidget, public virtual 
weld::LinkButton
 {
 private:
 VclPtr m_xButton;
@@ -2846,7 +2846,7 @@ private:
 public:
 SalInstanceLinkButton(FixedHyperlink* pButton, SalInstanceBuilder* 
pBuilder,
   bool bTakeOwnership)
-: SalInstanceContainer(pButton, pBuilder, bTakeOwnership)
+: SalInstanceWidget(pButton, pBuilder, bTakeOwnership)
 , m_xButton(pButton)
 {
 m_aOrigClickHdl = m_xButton->GetClickHdl();
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 523cc5cef594..3d06f899e572 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -6729,7 +6729,7 @@ public:
 }
 };
 
-class 

[Libreoffice-commits] core.git: extensions/source sal/qa sdext/source shell/source vcl/source

2021-04-27 Thread Stephan Bergmann (via logerrit)
 extensions/source/ole/unoconversionutilities.hxx |2 +-
 extensions/source/ole/unoobjw.cxx|2 +-
 sal/qa/osl/security/osl_Security.cxx |2 +-
 sdext/source/pdfimport/pdfparse/pdfparse.cxx |2 +-
 shell/source/win32/SysShExec.cxx |4 ++--
 vcl/source/opengl/win/WinDeviceInfo.cxx  |4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 3260edbeb59d87f3f3e5c700cda4b0fd6222df0c
Author: Stephan Bergmann 
AuthorDate: Tue Apr 27 08:44:09 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 27 15:45:27 2021 +0200

loplugin:stringadd (clang-cl)

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

diff --git a/extensions/source/ole/unoconversionutilities.hxx 
b/extensions/source/ole/unoconversionutilities.hxx
index 12a8533201a5..57ded2ce696c 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -1562,7 +1562,7 @@ void UnoConversionUtilities::variantToAny( const 
VARIANT* pVariant, Any& rAny
 if (!getType(sName, type))
 {
 throw CannotConvertException(
-  OUStringLiteral(u"[automation 
bridge]UnoConversionUtilities::variantToAny \n"
+  OUString::Concat("[automation 
bridge]UnoConversionUtilities::variantToAny \n"
   "A UNO type with the name: ") + 
o3tl::toU(LPCOLESTR(sName)) +
 "does not exist!",
 nullptr, TypeClass_UNKNOWN, 
FailReason::TYPE_NOT_SUPPORTED,0);
diff --git a/extensions/source/ole/unoobjw.cxx 
b/extensions/source/ole/unoobjw.cxx
index 5b47ecc18d31..2d935f8d9583 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -2898,7 +2898,7 @@ HRESULT InterfaceOleWrapper::InvokeGeneral( DISPID 
dispidMember, unsigned short
 Type type;
 if (!getType(arg.bstrVal, type))
 {
-writeExcepinfo(pexcepinfo, OUStringLiteral(u"[automation 
bridge] A UNO type with the name ") +
+writeExcepinfo(pexcepinfo, OUString::Concat("[automation 
bridge] A UNO type with the name ") +
o3tl::toU(arg.bstrVal) + " does not 
exist!");
 return DISP_E_EXCEPTION;
 }
diff --git a/sal/qa/osl/security/osl_Security.cxx 
b/sal/qa/osl/security/osl_Security.cxx
index b0b741d6cfe0..34417cd146fd 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -445,7 +445,7 @@ void MyTestPlugInImpl::initialize( 
CPPUNIT_NS::TestFactoryRegistry *,
 // for "JohnSmith" without domain returns domain itself. Try 
getting the SID of the
 // user using fully qualified name (the case of user of 
another domain having name
 // identical this hostname is not handled).
-sLookupUserName = o3tl::toU(wszDomainName) + 
OUStringLiteral(u"\\") + strUserName;
+sLookupUserName = OUString::Concat(o3tl::toU(wszDomainName)) + 
u"\\" + strUserName;
 wszAccName = o3tl::toW(sLookupUserName.getStr());
 continue;
 }
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx 
b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index ef0bfaea65f4..b2ffe23f06eb 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -581,7 +581,7 @@ std::unique_ptr PDFReader::read( const char* 
pBuffer, unsigned int nLe
 OString aTmp;
 unsigned int nElem = aGrammar.m_aObjectStack.size();
 for( unsigned int i = 0; i < nElem; i++ )
-aTmp += OStringLiteral("   ") + typeid( 
*(aGrammar.m_aObjectStack[i]) ).name();
+aTmp += OString::Concat("   ") + typeid( 
*(aGrammar.m_aObjectStack[i]) ).name();
 
 SAL_WARN("sdext.pdfimport.pdfparse", "parse error: " << 
rError.descriptor << " at buffer pos " << rError.where - pBuffer << ", object 
stack: " << aTmp);
 #else
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index fa83180705a0..8eec8b52d96f 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -258,7 +258,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (PathResolve(path, nullptr, PRF_VERIFYEXISTS | 
PRF_REQUIREABSOLUTE) == 0)
 {
 throw css::lang::IllegalArgumentException(
-OUStringLiteral(u"XSystemShellExecute.execute, 
PathResolve(") + o3tl::toU(path)
+OUString::Concat(u"XSystemShellExecute.execute, 
PathResolve(") + 

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

2021-04-12 Thread Noel Grandin (via logerrit)
 extensions/source/update/check/updatecheck.hxx |1 -
 include/xmloff/shapeimport.hxx |2 --
 include/xmloff/xmlnumfi.hxx|1 -
 xmloff/source/draw/ximp3dscene.cxx |6 +-
 xmloff/source/style/xmlnumfi.cxx   |5 -
 5 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 4627cac8e55e0789c23841c95d333815d4b44a09
Author: Noel Grandin 
AuthorDate: Mon Apr 12 14:35:41 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Apr 12 20:28:54 2021 +0200

loplugin:unusedfields

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

diff --git a/extensions/source/update/check/updatecheck.hxx 
b/extensions/source/update/check/updatecheck.hxx
index b7c0ba8d2c5f..546616f574dd 100644
--- a/extensions/source/update/check/updatecheck.hxx
+++ b/extensions/source/update/check/updatecheck.hxx
@@ -164,7 +164,6 @@ private:
 mutable std::recursive_mutex m_aMutex;
 WorkerThread *m_pThread;
 osl::Condition m_aCondition;
-osl::Condition m_NotInWaitState;
 
 UpdateInfo m_aUpdateInfo;
 OUString m_aImageName;
diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx
index 5fa670a35445..51bc59a25d1f 100644
--- a/include/xmloff/shapeimport.hxx
+++ b/include/xmloff/shapeimport.hxx
@@ -93,8 +93,6 @@ protected:
 ::basegfx::B3DVectormaVPN;
 ::basegfx::B3DVectormaVUP;
 boolmbVRPUsed;
-boolmbVPNUsed;
-boolmbVUPUsed;
 
 public:
 SdXML3DSceneAttributesHelper( SvXMLImport& rImporter );
diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx
index 84c6113ab80e..0f6384f3b785 100644
--- a/include/xmloff/xmlnumfi.hxx
+++ b/include/xmloff/xmlnumfi.hxx
@@ -148,7 +148,6 @@ private:
 OUStringBuffer aFormatCode{64};
 OUStringBuffer aConditions{32};
 boolbHasLongDoW;
-boolbHasEra;
 boolbHasDateTime;
 boolbRemoveAfterUse;
 
diff --git a/xmloff/source/draw/ximp3dscene.cxx 
b/xmloff/source/draw/ximp3dscene.cxx
index f6533a670bad..c1519346db88 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -198,9 +198,7 @@ SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( 
SvXMLImport& rImport
 maVRP(0.0, 0.0, 1.0),
 maVPN(0.0, 0.0, 1.0),
 maVUP(0.0, 1.0, 0.0),
-mbVRPUsed(false),
-mbVPNUsed(false),
-mbVUPUsed(false)
+mbVRPUsed(false)
 {
 }
 
@@ -251,7 +249,6 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( 
const sax_fastparser::
 if(aNewVec != maVPN)
 {
 maVPN = aNewVec;
-mbVPNUsed = true;
 }
 return;
 }
@@ -263,7 +260,6 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( 
const sax_fastparser::
 if(aNewVec != maVUP)
 {
 maVUP = aNewVec;
-mbVUPUsed = true;
 }
 return;
 }
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 3928b6788af1..824a05c68e9a 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1134,7 +1134,6 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( 
SvXMLImport& rImport,
 bAutoInt( false ),
 bHasExtraText( false ),
 bHasLongDoW( false ),
-bHasEra( false ),
 bHasDateTime( false ),
 bRemoveAfterUse( false ),
 eDateDOW( XML_DEA_NONE ),
@@ -1271,7 +1270,6 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( 
SvXMLImport& rImport,
 bAutoInt( false ),
 bHasExtraText( false ),
 bHasLongDoW( false ),
-bHasEra( false ),
 bHasDateTime( false ),
 bRemoveAfterUse( false ),
 eDateDOW( XML_DEA_NONE ),
@@ -1872,9 +1870,6 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 
nIndex )
 if (!pFormatter)
 return;
 
-if ( nIndex == NF_KEY_G || nIndex == NF_KEY_GG || nIndex == NF_KEY_GGG )
-bHasEra = true;
-
 if ( nIndex == NF_KEY_ )
 {
 nIndex = NF_KEY_NNN;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-01 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/usercontrol.cxx |9 ++---
 extensions/source/propctrlr/usercontrol.hxx |7 ++-
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 304e65f5f8fa139aaf5868db4205a95d0176695c
Author: Caolán McNamara 
AuthorDate: Thu Apr 1 17:31:58 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 1 22:01:03 2021 +0200

tdf#141084 don't notify that the control has changed content until focus-out

while also keeping tdf#140239 working too

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

diff --git a/extensions/source/propctrlr/usercontrol.cxx 
b/extensions/source/propctrlr/usercontrol.cxx
index fbf829b62938..345162ecffa0 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -248,9 +248,7 @@ namespace pcr
 bool bSuccess = rValue >>= sURL;
 if (bSuccess && GraphicObject::isGraphicObjectUniqueIdURL(sURL))
 sURL = pControlWindow->GetPlaceHolder();
-// tdf#140239 leave current cursor valid if the contents won't change
-if (sURL != pControlWindow->GetURL())
-pControlWindow->set_entry_text(sURL);
+pControlWindow->set_entry_text(sURL);
 }
 
 Any SAL_CALL OFileUrlControl::getValue()
@@ -266,6 +264,11 @@ namespace pcr
 return ::cppu::UnoType::get();
 }
 
+IMPL_LINK_NOARG(OFileUrlControl, URLModifiedHdl, weld::ComboBox&, void)
+{
+editChanged();
+}
+
 } // namespace pcr
 
 
diff --git a/extensions/source/propctrlr/usercontrol.hxx 
b/extensions/source/propctrlr/usercontrol.hxx
index 5e27a3dc61cf..86b53e7f122e 100644
--- a/extensions/source/propctrlr/usercontrol.hxx
+++ b/extensions/source/propctrlr/usercontrol.hxx
@@ -118,6 +118,8 @@ namespace pcr
 typedef CommonBehaviourControl OFileUrlControl_Base;
 class OFileUrlControl : public OFileUrlControl_Base
 {
+private:
+DECL_LINK(URLModifiedHdl, weld::ComboBox&, void);
 public:
 OFileUrlControl(std::unique_ptr xWidget, 
std::unique_ptr xBuilder, bool bReadOnly);
 
@@ -129,7 +131,10 @@ namespace pcr
 virtual void SetModifyHandler() override
 {
 OFileUrlControl_Base::SetModifyHandler();
-getTypedControlWindow()->connect_changed(LINK(this, 
CommonBehaviourControlHelper, ModifiedHdl));
+SvtURLBox* pControlWindow = getTypedControlWindow();
+// tdf#140239 and tdf#141084 don't notify that the control has 
changed content until focus-out
+pControlWindow->connect_focus_out(LINK(this, 
CommonBehaviourControlHelper, LoseFocusHdl));
+pControlWindow->connect_changed(LINK(this, OFileUrlControl, 
URLModifiedHdl));
 }
 
 virtual weld::Widget* getWidget() override { return 
getTypedControlWindow()->getWidget(); }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-31 Thread Henry Castro (via logerrit)
 extensions/source/bibliography/framectr.cxx |   73 ++--
 extensions/source/bibliography/framectr.hxx |   12 ++--
 2 files changed, 43 insertions(+), 42 deletions(-)

New commits:
commit edc7b4bad6361f00aff69b65a722fb230c6e120c
Author: Henry Castro 
AuthorDate: Wed Mar 31 09:44:24 2021 -0400
Commit: Henry Castro 
CommitDate: Wed Mar 31 21:12:19 2021 +0200

lok: "BibFrameController_Impl" prefix m_* members

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

diff --git a/extensions/source/bibliography/framectr.cxx 
b/extensions/source/bibliography/framectr.cxx
index 2bb4246fe4c5..7b0a5dd9eaba 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -147,17 +147,17 @@ void BibFrameCtrl_Impl::disposing( const 
lang::EventObject& /*Source*/ )
 
 BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< 
awt::XWindow > & xComponent,
 BibDataManager* pDataManager)
-:xWindow( xComponent )
+:m_xWindow( xComponent )
 ,m_xDatMan( pDataManager )
 {
-bDisposing=false;
-mxImpl = new BibFrameCtrl_Impl;
-mxImpl->pController = this;
+m_bDisposing = false;
+m_xImpl = new BibFrameCtrl_Impl;
+m_xImpl->pController = this;
 }
 
 BibFrameController_Impl::~BibFrameController_Impl()
 {
-mxImpl->pController = nullptr;
+m_xImpl->pController = nullptr;
 m_xDatMan.clear();
 }
 
@@ -180,8 +180,8 @@ css::uno::Sequence< OUString > SAL_CALL 
BibFrameController_Impl::getSupportedSer
 
 void BibFrameController_Impl::attachFrame( const uno::Reference< XFrame > & 
xArg )
 {
-xFrame = xArg;
-xFrame->addFrameActionListener( mxImpl );
+m_xFrame = xArg;
+m_xFrame->addFrameActionListener( m_xImpl );
 }
 
 sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > 
& /*xModel*/ )
@@ -192,9 +192,9 @@ sal_Bool BibFrameController_Impl::attachModel( const 
uno::Reference< XModel > &
 sal_Bool BibFrameController_Impl::suspend( sal_Bool bSuspend )
 {
 if ( bSuspend )
-getFrame()->removeFrameActionListener( mxImpl );
+getFrame()->removeFrameActionListener( m_xImpl );
 else
-getFrame()->addFrameActionListener( mxImpl );
+getFrame()->addFrameActionListener( m_xImpl );
 return true;
 }
 
@@ -209,7 +209,7 @@ void BibFrameController_Impl::restoreViewData( const 
uno::Any& /*Value*/ )
 
 uno::Reference< XFrame >  BibFrameController_Impl::getFrame()
 {
-return xFrame;
+return m_xFrame;
 }
 
 uno::Reference< XModel >  BibFrameController_Impl::getModel()
@@ -219,28 +219,28 @@ uno::Reference< XModel >  
BibFrameController_Impl::getModel()
 
 void BibFrameController_Impl::dispose()
 {
-bDisposing = true;
+m_bDisposing = true;
 lang::EventObject aObject;
 aObject.Source = static_cast(this);
-mxImpl->aLC.disposeAndClear(aObject);
+m_xImpl->aLC.disposeAndClear(aObject);
 m_xDatMan.clear();
-aStatusListeners.clear();
+m_aStatusListeners.clear();
 m_xLastQueriedFocusWin.clear();
 }
 
 void BibFrameController_Impl::addEventListener( const uno::Reference< 
lang::XEventListener > & aListener )
 {
-mxImpl->aLC.addInterface( cppu::UnoType::get(), 
aListener );
+m_xImpl->aLC.addInterface( cppu::UnoType::get(), 
aListener );
 }
 
 void BibFrameController_Impl::removeEventListener( const uno::Reference< 
lang::XEventListener > & aListener )
 {
-mxImpl->aLC.removeInterface( cppu::UnoType::get(), 
aListener );
+m_xImpl->aLC.removeInterface( cppu::UnoType::get(), 
aListener );
 }
 
 uno::Reference< frame::XDispatch >  BibFrameController_Impl::queryDispatch( 
const util::URL& aURL, const OUString& /*aTarget*/, sal_Int32 /*nSearchFlags*/ )
 {
-if ( !bDisposing )
+if ( !m_bDisposing )
 {
 const CmdToInfoCache& rCmdCache = GetCommandToInfoCache();
 CmdToInfoCache::const_iterator pIter = rCmdCache.find( aURL.Complete );
@@ -366,11 +366,11 @@ static vcl::Window* lcl_GetFocusChild( vcl::Window const 
* pParent )
 //class XDispatch
 void BibFrameController_Impl::dispatch(const util::URL& _rURL, const 
uno::Sequence< beans::PropertyValue >& aArgs)
 {
-if ( bDisposing )
+if ( m_bDisposing )
 return;
 
 ::SolarMutexGuard aGuard;
-weld::Window* pParent = Application::GetFrameWeld(xWindow);
+weld::Window* pParent = Application::GetFrameWeld(m_xWindow);
 weld::WaitObject aWaitObject(pParent);
 
 OUString aCommand( _rURL.Path);
@@ -404,10 +404,10 @@ void BibFrameController_Impl::dispatch(const util::URL& 
_rURL, const uno::Sequen
 }
 else if(aCommand == "Bib/autoFilter")
 {
-sal_uInt16 nCount = aStatusListeners.size();
+sal_uInt16 nCount = m_aStatusListeners.size();
 for ( sal_uInt16 n=0; naURL.Path == "Bib/removeFilter" )
 

[Libreoffice-commits] core.git: extensions/source extensions/test

2021-03-23 Thread Vincent LE GARREC (via logerrit)
 extensions/source/activex/SOActionsApproval.h   |5 
+
 extensions/source/activex/SOActiveX.h   |5 
+
 extensions/source/activex/SOComWindowPeer.h |5 
+
 extensions/source/activex/SODispatchInterceptor.h   |5 
+
 extensions/source/activex/StdAfx2.h |5 
+
 extensions/source/bibliography/bibbeam.hxx  |5 
+
 extensions/source/bibliography/bibconfig.hxx|4 +---
 extensions/source/bibliography/bibcont.hxx  |5 
+
 extensions/source/bibliography/bibmod.hxx   |5 
+
 extensions/source/bibliography/bibresid.hxx |5 
+
 extensions/source/bibliography/bibshortcuthandler.hxx   |5 
+
 extensions/source/bibliography/bibtools.hxx |5 
+
 extensions/source/bibliography/bibview.hxx  |5 
+
 extensions/source/bibliography/datman.hxx   |5 
+
 extensions/source/bibliography/formcontrolcontainer.hxx |5 
+
 extensions/source/bibliography/framectr.hxx |5 
+
 extensions/source/bibliography/general.hxx  |5 
+
 extensions/source/bibliography/loadlisteneradapter.hxx  |5 
+
 extensions/source/bibliography/toolbar.hxx  |5 
+
 extensions/source/config/WinUserInfo/WinUserInfoBe.hxx  |5 
+
 extensions/source/config/ldap/ldapaccess.hxx|5 
+
 extensions/source/config/ldap/ldapuserprofilebe.hxx |5 
+
 extensions/source/dbpilots/commonpagesdbp.hxx   |5 
+
 extensions/source/dbpilots/controlwizard.hxx|5 
+
 extensions/source/dbpilots/dbptools.hxx |5 
+
 extensions/source/dbpilots/dbptypes.hxx |5 
+
 extensions/source/dbpilots/gridwizard.hxx   |5 
+
 extensions/source/dbpilots/groupboxwiz.hxx  |5 
+
 extensions/source/dbpilots/listcombowizard.hxx  |5 
+
 extensions/source/dbpilots/optiongrouplayouter.hxx  |5 
+
 extensions/source/dbpilots/unoautopilot.hxx |5 
+
 extensions/source/dbpilots/wizardcontext.hxx|5 
+
 extensions/source/inc/componentmodule.hxx   |5 
+
 extensions/source/logging/loggerconfig.hxx  |5 
+
 extensions/source/logging/loghandler.hxx|5 
+
 extensions/source/logging/logrecord.hxx |5 
+
 extensions/source/logging/methodguard.hxx   |5 
+
 extensions/source/macosx/spotlight/GetMetadataForFile.h |5 
+
 extensions/source/ole/comifaces.hxx |5 
+
 extensions/source/ole/jscriptclasses.hxx|5 
+
 extensions/source/ole/ole2uno.hxx   |5 
+
 extensions/source/ole/oleobjw.hxx   |5 
+
 extensions/source/ole/servprov.hxx  |5 
+
 extensions/source/ole/unoconversionutilities.hxx|5 
+
 extensions/source/ole/unoobjw.hxx   |5 
+
 extensions/source/ole/unotypewrapper.hxx|5 
+
 extensions/source/ole/wincrap.hxx   |5 
+
 extensions/source/ole/windata.hxx   |5 
+
 extensions/source/propctrlr/MasterDetailLinkDialog.hxx  |5 
+
 extensions/source/propctrlr/browserline.hxx |5 
+
 extensions/source/propctrlr/browserlistbox.hxx  |5 
+
 extensions/source/propctrlr/browserpage.hxx |5 
+
 extensions/source/propctrlr/browserview.hxx |5 
+
 extensions/source/propctrlr/buttonnavigationhandler.hxx |5 
+
 extensions/source/propctrlr/cellbindinghandler.hxx  |5 
+
 extensions/source/propctrlr/cellbindinghelper.hxx   |5 
+
 extensions/source/propctrlr/commoncontrol.hxx   |5 
+
 extensions/source/propctrlr/composeduiupdate.hxx|5 
+
 extensions/source/propctrlr/controlfontdialog.hxx   |5 
+
 extensions/source/propctrlr/controltype.hxx |5 
+
 

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

2021-03-23 Thread Noel Grandin (via logerrit)
 extensions/source/logging/log.component |3 ++-
 extensions/source/logging/logger.cxx|   21 +
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 5947744bd722b17a27243a86fffb45c188f169a5
Author: Noel Grandin 
AuthorDate: Mon Mar 22 13:27:55 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 23 07:41:25 2021 +0100

use single-use attribute for LoggerPool

instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down

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

diff --git a/extensions/source/logging/log.component 
b/extensions/source/logging/log.component
index d4bda58c6900..ae221bb5768d 100644
--- a/extensions/source/logging/log.component
+++ b/extensions/source/logging/log.component
@@ -32,7 +32,8 @@
 
   
   
+  constructor="com_sun_star_comp_extensions_LoggerPool"
+  single-instance="true">
 
   
const & context):
-instance(static_cast(new 
logging::LoggerPool(context)))
-{}
-
-rtl::Reference instance;
-};
-
-struct Singleton:
-public rtl::StaticWithArg<
-Instance, css::uno::Reference, Singleton>
-{};
-
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
 com_sun_star_comp_extensions_LoggerPool(
 css::uno::XComponentContext *context,
 css::uno::Sequence const &)
 {
-return cppu::acquire(static_cast(
-Singleton::get(context).instance.get()));
+return cppu::acquire(new logging::LoggerPool(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-21 Thread Caolán McNamara (via logerrit)
 extensions/source/update/check/download.cxx |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 96903f858e2f0b991350598f8b8bbe1b18d7bdc3
Author: Caolán McNamara 
AuthorDate: Sun Mar 21 15:00:28 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 21 20:47:34 2021 +0100

cid#1474008 silence Unchecked return value from library

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

diff --git a/extensions/source/update/check/download.cxx 
b/extensions/source/update/check/download.cxx
index 3e8ad4e2c09c..1f98b7717be2 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -225,37 +225,37 @@ static bool curl_run(std::u16string_view rURL, OutData& 
out, const OString& aPro
 out.curl = pCURL;
 
 OString aURL(OUStringToOString(rURL, RTL_TEXTENCODING_UTF8));
-curl_easy_setopt(pCURL, CURLOPT_URL, aURL.getStr());
+(void)curl_easy_setopt(pCURL, CURLOPT_URL, aURL.getStr());
 
 // abort on http errors
-curl_easy_setopt(pCURL, CURLOPT_FAILONERROR, 1);
+(void)curl_easy_setopt(pCURL, CURLOPT_FAILONERROR, 1);
 
 // enable redirection
-curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1);
+(void)curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1);
 // only allow redirect to http:// and https://
-curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | 
CURLPROTO_HTTPS);
+(void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP 
| CURLPROTO_HTTPS);
 
 // write function
-curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, );
-curl_easy_setopt(pCURL, CURLOPT_WRITEFUNCTION, _function);
+(void)curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, );
+(void)curl_easy_setopt(pCURL, CURLOPT_WRITEFUNCTION, _function);
 
 // progress handler - Condition::check unfortunately is not defined 
const
-curl_easy_setopt(pCURL, CURLOPT_NOPROGRESS, 0);
-curl_easy_setopt(pCURL, CURLOPT_PROGRESSFUNCTION, _callback);
-curl_easy_setopt(pCURL, CURLOPT_PROGRESSDATA, );
+(void)curl_easy_setopt(pCURL, CURLOPT_NOPROGRESS, 0);
+(void)curl_easy_setopt(pCURL, CURLOPT_PROGRESSFUNCTION, 
_callback);
+(void)curl_easy_setopt(pCURL, CURLOPT_PROGRESSDATA, );
 
 // proxy
-curl_easy_setopt(pCURL, CURLOPT_PROXY, aProxyHost.getStr());
-curl_easy_setopt(pCURL, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+(void)curl_easy_setopt(pCURL, CURLOPT_PROXY, aProxyHost.getStr());
+(void)curl_easy_setopt(pCURL, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
 if( -1 != nProxyPort )
-curl_easy_setopt(pCURL, CURLOPT_PROXYPORT, nProxyPort);
+(void)curl_easy_setopt(pCURL, CURLOPT_PROXYPORT, nProxyPort);
 
 if( out.Offset > 0 )
 {
 // curl_off_t offset = nOffset; libcurl seems to be compiled with 
large
 // file support (and we not) ..
 sal_Int64 offset = static_cast(out.Offset);
-curl_easy_setopt(pCURL, CURLOPT_RESUME_FROM_LARGE, offset);
+(void)curl_easy_setopt(pCURL, CURLOPT_RESUME_FROM_LARGE, offset);
 }
 
 CURLcode cc = curl_easy_perform(pCURL);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-12 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/propcontroller.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 32b7c32aa84dc51d3acd75bde5db7655868e5ad9
Author: Caolán McNamara 
AuthorDate: Thu Mar 11 15:48:09 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 12 10:04:11 2021 +0100

use VCLUnoHelper::GetWindow

instead of directly using VCLXWindow

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

diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index 1835501e5525..d9166b64dff6 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -38,7 +38,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -344,8 +344,7 @@ namespace pcr
 }
 else
 {
-VCLXWindow* pContainerWindow = 
comphelper::getUnoTunnelImplementation(xContainerWindow);
-VclPtr pParentWin = pContainerWindow ? 
pContainerWindow->GetWindow() : nullptr;
+VclPtr pParentWin = 
VCLUnoHelper::GetWindow(xContainerWindow);
 if (!pParentWin)
 throw RuntimeException("The frame is invalid. Unable to 
extract the container window.",*this);
 xBuilder.reset(Application::CreateInterimBuilder(pParentWin, 
sUIFile, true));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-12 Thread Caolán McNamara (via logerrit)
 extensions/source/bibliography/bibload.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 07d278c911d738f06c3bbb6354336ac03c8146e1
Author: Caolán McNamara 
AuthorDate: Thu Mar 11 15:39:43 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 12 10:03:32 2021 +0100

awt::XWindow has setVisible so don't need to fetch VCLXWindow to do that

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

diff --git a/extensions/source/bibliography/bibload.cxx 
b/extensions/source/bibliography/bibload.cxx
index 2bacc3c31477..cb1edd54fef4 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -211,9 +210,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > 
& rFrame,
 
 m_xDatMan->createDatabaseForm( aBibDesc );
 
-Reference< awt::XWindow >  aWindow = rFrame->getContainerWindow();
-VCLXWindow* pParentComponent = 
comphelper::getUnoTunnelImplementation(aWindow);
-assert(pParentComponent);
+Reference aWindow = rFrame->getContainerWindow();
 
 VclPtr pParent = VCLUnoHelper::GetWindow( aWindow );
 
@@ -238,10 +235,10 @@ void BibliographyLoader::loadView(const Reference< XFrame 
> & rFrame,
 rFrame->setComponent( xWin, xCtrRef);
 pBeamer->SetXController(xCtrRef);
 
-if (pParentComponent)
+if (aWindow)
 {
 // not earlier because SetFocus() is triggered in setVisible()
-pParentComponent->setVisible(true);
+aWindow->setVisible(true);
 }
 
 Reference(m_xDatMan)->load();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: extensions/source include/vcl solenv/clang-format vcl/inc vcl/source

2021-03-03 Thread Caolán McNamara (via logerrit)
 extensions/source/update/ui/updatecheckui.cxx |6 -
 include/vcl/menubarupdateicon.hxx |   89 ++
 solenv/clang-format/excludelist   |2 
 vcl/inc/bubblewindow.hxx  |   57 
 vcl/source/window/bubblewindow.cxx|3 
 5 files changed, 94 insertions(+), 63 deletions(-)

New commits:
commit 991ce31833b3e14e75f56b213bcb71bd18d4f980
Author: Caolán McNamara 
AuthorDate: Tue Mar 2 09:35:01 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 3 10:19:08 2021 +0100

bubblewindow.hxx can be a private vcl header

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

diff --git a/extensions/source/update/ui/updatecheckui.cxx 
b/extensions/source/update/ui/updatecheckui.cxx
index b9582b465410..a39de0bbd3cb 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -31,12 +31,10 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/include/vcl/menubarupdateicon.hxx 
b/include/vcl/menubarupdateicon.hxx
new file mode 100644
index ..0b021519dffd
--- /dev/null
+++ b/include/vcl/menubarupdateicon.hxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+
+class BubbleWindow;
+class SystemWindow;
+class VclSimpleEvent;
+class VclWindowEvent;
+
+class VCL_DLLPUBLIC MenuBarUpdateIconManager
+{
+private:
+OUString maBubbleTitle;
+OUString maBubbleText;
+OUString maBubbleImageURL;
+Image maBubbleImage;
+VclPtr mpBubbleWin;
+VclPtr mpIconSysWin;
+VclPtr mpIconMBar;
+
+Link maWindowEventHdl;
+Link maApplicationEventHdl;
+Link maClickHdl;
+
+Timer maTimeoutTimer;
+Idle maWaitIdle;
+
+sal_uInt16 mnIconID;
+
+bool mbShowMenuIcon;
+bool mbShowBubble;
+bool mbBubbleChanged;
+
+DECL_LINK(UserEventHdl, void*, void);
+DECL_LINK(TimeOutHdl, Timer*, void);
+DECL_LINK(WindowEventHdl, VclWindowEvent&, void);
+DECL_LINK(ApplicationEventHdl, VclSimpleEvent&, void);
+DECL_LINK(WaitTimeOutHdl, Timer*, void);
+DECL_LINK(ClickHdl, MenuBar::MenuBarButtonCallbackArg&, bool);
+DECL_LINK(HighlightHdl, MenuBar::MenuBarButtonCallbackArg&, bool);
+
+VclPtr GetBubbleWindow();
+void SetBubbleChanged();
+
+public:
+MenuBarUpdateIconManager();
+~MenuBarUpdateIconManager();
+
+void SetShowMenuIcon(bool bShowMenuIcon);
+void SetShowBubble(bool bShowBubble);
+void SetBubbleImage(const Image& rImage);
+void SetBubbleTitle(const OUString& rTitle);
+void SetBubbleText(const OUString& rText);
+
+void SetClickHdl(const Link& rHdl) { maClickHdl = 
rHdl; }
+
+bool GetShowMenuIcon() const { return mbShowMenuIcon; }
+bool GetShowBubble() const { return mbShowBubble; }
+OUString GetBubbleTitle() const { return maBubbleTitle; }
+OUString GetBubbleText() const { return maBubbleText; }
+
+void RemoveBubbleWindow(bool bRemoveIcon);
+
+void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 88ecdff9981c..e51305a2f579 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -6363,7 +6363,6 @@ include/vcl/accessibletableprovider.hxx
 include/vcl/alpha.hxx
 include/vcl/bitmap.hxx
 include/vcl/bitmapex.hxx
-include/vcl/bubblewindow.hxx
 include/vcl/builder.hxx
 include/vcl/builderfactory.hxx
 include/vcl/cairo.hxx
@@ -14453,6 +14452,7 @@ vcl/inc/bitmap/bmpfast.hxx
 vcl/inc/accel.h
 vcl/inc/accmgr.hxx
 vcl/inc/brdwin.hxx
+vcl/inc/bubblewindow.hxx
 vcl/inc/calendar.hxx
 vcl/inc/canvasbitmap.hxx
 vcl/inc/configsettings.hxx
diff --git a/include/vcl/bubblewindow.hxx b/vcl/inc/bubblewindow.hxx
similarity index 53%
rename 

[Libreoffice-commits] core.git: extensions/source include/vcl solenv/clang-format vcl/Library_vcl.mk vcl/source

2021-03-03 Thread Caolán McNamara (via logerrit)
 extensions/source/update/ui/updatecheckui.cxx |  235 --
 include/vcl/bubblewindow.hxx  |   55 ++
 solenv/clang-format/excludelist   |2 
 vcl/Library_vcl.mk|1 
 vcl/source/window/bubblewindow.cxx|  219 
 5 files changed, 278 insertions(+), 234 deletions(-)

New commits:
commit 9bebf9c676f88c67c04ca4f96d88ee2543c5b9e9
Author: Caolán McNamara 
AuthorDate: Mon Mar 1 17:04:54 2021 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 3 10:07:58 2021 +0100

move BubbleWindow to vcl

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

diff --git a/extensions/source/update/ui/updatecheckui.cxx 
b/extensions/source/update/ui/updatecheckui.cxx
index 3a177327d256..c73db90d4a4f 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -32,7 +32,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -76,37 +76,6 @@ Image GetMenuBarIcon( MenuBar const * pMBar )
 return Image(StockImage::Yes, sResID);
 }
 
-class BubbleWindow : public FloatingWindow
-{
-Point   maTipPos;
-vcl::Region maBounds;
-tools::Polygon  maRectPoly;
-tools::Polygon  maTriPoly;
-OUStringmaBubbleTitle;
-OUStringmaBubbleText;
-Image   maBubbleImage;
-SizemaMaxTextSize;
-tools::Rectangle   maTitleRect;
-tools::Rectangle   maTextRect;
-tools::Long mnTipOffset;
-
-private:
-voidRecalcTextRects();
-
-public:
-BubbleWindow( vcl::Window* pParent, const OUString& rTitle,
-  const OUString& rText, const Image& rImage );
-
-virtual voidMouseButtonDown( const MouseEvent& rMEvt ) override;
-virtual voidPaint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
-voidResize() override;
-voidShow( bool bVisible = true );
-voidSetTipPosPixel( const Point& rTipPos ) { maTipPos = 
rTipPos; }
-voidSetTitleAndText( const OUString& rTitle, const OUString& 
rText,
- const Image& rImage );
-};
-
-
 class UpdateCheckUI : public ::cppu::WeakImplHelper
 < lang::XServiceInfo, 
document::XDocumentEventListener, beans::XPropertySet >
 {
@@ -673,208 +642,6 @@ IMPL_LINK( UpdateCheckUI, ApplicationEventHdl, 
VclSimpleEvent&, rEvent, void)
 }
 }
 
-
-#define TIP_HEIGHT 15
-#define TIP_WIDTH   7
-#define TIP_RIGHT_OFFSET   18
-#define BUBBLE_BORDER  10
-#define TEXT_MAX_WIDTH300
-#define TEXT_MAX_HEIGHT   200
-
-
-BubbleWindow::BubbleWindow( vcl::Window* pParent, const OUString& rTitle,
-const OUString& rText, const Image& rImage )
-: FloatingWindow( pParent, WB_SYSTEMWINDOW
-   | WB_OWNERDRAWDECORATION
-   | WB_NOBORDER
-)
-, maBubbleTitle( rTitle )
-, maBubbleText( rText )
-, maBubbleImage( rImage )
-, maMaxTextSize( TEXT_MAX_WIDTH, TEXT_MAX_HEIGHT )
-, mnTipOffset( 0 )
-{
-SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetHelpColor() 
) );
-}
-
-void BubbleWindow::Resize()
-{
-SolarMutexGuard aGuard;
-
-FloatingWindow::Resize();
-
-Size aSize = GetSizePixel();
-
-if ( ( aSize.Height() < 20 ) || ( aSize.Width() < 60 ) )
-return;
-
-tools::Rectangle aRect( 0, TIP_HEIGHT, aSize.Width(), aSize.Height() - 
TIP_HEIGHT );
-maRectPoly = tools::Polygon( aRect, 6, 6 );
-vcl::Region aRegion( maRectPoly );
-tools::Long nTipOffset = aSize.Width() - TIP_RIGHT_OFFSET + mnTipOffset;
-
-Point aPointArr[4];
-aPointArr[0] = Point( nTipOffset, TIP_HEIGHT );
-aPointArr[1] = Point( nTipOffset, 0 );
-aPointArr[2] = Point( nTipOffset + TIP_WIDTH , TIP_HEIGHT );
-aPointArr[3] = Point( nTipOffset, TIP_HEIGHT );
-maTriPoly = tools::Polygon( 4, aPointArr );
-vcl::Region aTriRegion( maTriPoly );
-
-aRegion.Union( aTriRegion);
-maBounds = aRegion;
-
-SetWindowRegionPixel( maBounds );
-}
-
-
-void BubbleWindow::SetTitleAndText( const OUString& rTitle,
-const OUString& rText,
-const Image& rImage )
-{
-maBubbleTitle = rTitle;
-maBubbleText = rText;
-maBubbleImage = rImage;
-
-Resize();
-}
-
-
-void BubbleWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const 
tools::Rectangle& /*rRect*/)
-{
-SolarMutexGuard aGuard;
-
-LineInfo aThickLine( LineStyle::Solid, 2 );
-
-DrawPolyLine( maRectPoly, aThickLine );
-DrawPolyLine( maTriPoly );
-
-

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

2021-02-27 Thread Noel (via logerrit)
 extensions/source/bibliography/bibmod.cxx |2 +-
 extensions/source/bibliography/bibmod.hxx |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 92b96423e0cf494e562e9771fc2b315d46fffc39
Author: Noel 
AuthorDate: Fri Feb 26 15:22:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 27 11:55:08 2021 +0100

loplugin:refcounting in extensions

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

diff --git a/extensions/source/bibliography/bibmod.cxx 
b/extensions/source/bibliography/bibmod.cxx
index 1a4f6cca47d2..c355e836a02b 100644
--- a/extensions/source/bibliography/bibmod.cxx
+++ b/extensions/source/bibliography/bibmod.cxx
@@ -74,7 +74,7 @@ BibModul::~BibModul()
 pBibConfig = nullptr;
 }
 
-BibDataManager*  BibModul::createDataManager()
+rtl::Reference  BibModul::createDataManager()
 {
 return new BibDataManager();
 }
diff --git a/extensions/source/bibliography/bibmod.hxx 
b/extensions/source/bibliography/bibmod.hxx
index e651f720e753..6720b50bc549 100644
--- a/extensions/source/bibliography/bibmod.hxx
+++ b/extensions/source/bibliography/bibmod.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_BIBMOD_HXX
 
 #include 
+#include 
 
 class BibDataManager;
 class BibConfig;
@@ -38,7 +39,7 @@ class BibModul
 const std::locale&  GetResLocale() const { return m_aResLocale; }
 static BibConfig*   GetConfig();
 
-static BibDataManager*  createDataManager();
+static rtl::Reference  createDataManager();
 
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-24 Thread Xisco Fauli (via logerrit)
 extensions/source/propctrlr/formcomponenthandler.cxx |   10 --
 extensions/source/propctrlr/propcontroller.cxx   |   10 ++
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 8c2251481a10dc26c969c72e7a5b7cc910996441
Author: Xisco Fauli 
AuthorDate: Wed Feb 24 12:22:19 2021 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 24 15:42:07 2021 +0100

Move code for setting unique buildable names one level up

this way, we also set the name for elements like the
listbox 'Text type'

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

diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index ccd910553249..ceac37326a0a 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -1375,16 +1375,6 @@ namespace pcr
 if ( !aDescriptor.SecondaryButtonId.isEmpty() )
 aDescriptor.HasSecondaryButton = true;
 
-// for ui-testing try and distinguish different instances of the 
controls
-auto xWindow = aDescriptor.Control->getControlWindow();
-if (weld::TransportAsXWindow* pTunnel = 
dynamic_cast(xWindow.get()))
-{
-weld::Widget* m_pControlWindow = pTunnel->getWidget();
-if (m_pControlWindow)
-
m_pControlWindow->set_buildable_name(m_pControlWindow->get_buildable_name() + 
"-" + aDescriptor.DisplayName.toUtf8());
-}
-
-
 bool bIsDataProperty = ( nPropertyUIFlags & PROP_FLAG_DATA_PROPERTY ) 
!= 0;
 aDescriptor.Category = bIsDataProperty ? std::u16string_view(u"Data") 
: std::u16string_view(u"General");
 return aDescriptor;
diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index bde1e1f56e3e..4ed339fb2d42 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -1105,6 +1105,16 @@ namespace pcr
 }
 
 _rDescriptor.bReadOnly = impl_isReadOnlyModel_throw();
+
+// for ui-testing try and distinguish different instances of the 
controls
+auto xWindow = _rDescriptor.Control->getControlWindow();
+if (weld::TransportAsXWindow* pTunnel = 
dynamic_cast(xWindow.get()))
+{
+weld::Widget* m_pControlWindow = pTunnel->getWidget();
+if (m_pControlWindow)
+
m_pControlWindow->set_buildable_name(m_pControlWindow->get_buildable_name() + 
"-" + _rDescriptor.DisplayName.toUtf8());
+}
+
 }
 catch( const Exception& )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-23 Thread Xisco Fauli (via logerrit)
 extensions/source/propctrlr/formcomponenthandler.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit ed796e0fcd47edcc1df2766a08aaf0cb85622bab
Author: Xisco Fauli 
AuthorDate: Tue Feb 23 15:29:06 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Feb 23 20:41:57 2021 +0100

Set unique buildable names to each widget in the form properties dialog

the dialog has many 'listbox' items and it is not possible to use
them in uitests if they have the same name

follow-up of d4ca173f2babde53c1d20f10e335244b092c5c97

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

diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx 
b/extensions/source/propctrlr/formcomponenthandler.cxx
index 1fd26057a110..ccd910553249 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -1108,8 +1108,6 @@ namespace pcr
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/formattedcontrol.ui",
 m_xContext));
 auto pSpinButton = 
xBuilder->weld_formatted_spin_button("formattedcontrol");
-// for ui-testing try and distinguish different 
instances of this formatted control
-
pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() + "-" + 
aDescriptor.DisplayName.toUtf8());
 rtl::Reference pControl = 
new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), 
false);
 pControl->SetModifyHandler();
 
@@ -1149,8 +1147,6 @@ namespace pcr
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/formattedcontrol.ui",
 m_xContext));
 auto pSpinButton = 
xBuilder->weld_formatted_spin_button("formattedcontrol");
-// for ui-testing try and distinguish different instances of this 
formatted control
-pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() 
+ "-" + aDescriptor.DisplayName.toUtf8());
 rtl::Reference pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 aDescriptor.Control = pControl;
@@ -1212,7 +1208,6 @@ namespace pcr
 break;
 }
 
-
 if ( eType == TypeClass_SEQUENCE )
 nControlType = PropertyControlType::StringListField;
 
@@ -1380,6 +1375,16 @@ namespace pcr
 if ( !aDescriptor.SecondaryButtonId.isEmpty() )
 aDescriptor.HasSecondaryButton = true;
 
+// for ui-testing try and distinguish different instances of the 
controls
+auto xWindow = aDescriptor.Control->getControlWindow();
+if (weld::TransportAsXWindow* pTunnel = 
dynamic_cast(xWindow.get()))
+{
+weld::Widget* m_pControlWindow = pTunnel->getWidget();
+if (m_pControlWindow)
+
m_pControlWindow->set_buildable_name(m_pControlWindow->get_buildable_name() + 
"-" + aDescriptor.DisplayName.toUtf8());
+}
+
+
 bool bIsDataProperty = ( nPropertyUIFlags & PROP_FLAG_DATA_PROPERTY ) 
!= 0;
 aDescriptor.Category = bIsDataProperty ? std::u16string_view(u"Data") 
: std::u16string_view(u"General");
 return aDescriptor;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-23 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/standardcontrol.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8365076e896238d1dc870910f5fd6234d0931f7b
Author: Caolán McNamara 
AuthorDate: Tue Feb 23 15:46:18 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 23 20:19:12 2021 +0100

tdf#139070 format entry view of multilines with final formatting

so during editing of a multiline the singleline entry shows what
it will show when editing is finished, so we suppress the default
behaviour of gtk to show a newline symbol and the default
behaviour of vcl to strip newlines

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

diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index c20f6287fe8d..2307d0bf01f4 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -741,7 +741,16 @@ namespace pcr
 
 IMPL_LINK_NOARG(OMultilineEditControl, TextViewModifiedHdl, 
weld::TextView&, void)
 {
-m_xEntry->set_text(m_xTextView->get_text());
+// tdf#139070 during editing update the entry to look like how it will
+// look once editing is finished so that the default behaviour of vcl
+// to strip newlines and the default behaviour of gtk to show a newline
+// symbol is suppressed
+OUString sText = m_xTextView->get_text();
+auto aSeq = lcl_convertMultiLineToList(sText);
+if (aSeq.getLength() > 1)
+m_xEntry->set_text(lcl_convertListToDisplayText(aSeq));
+else
+m_xEntry->set_text(sText);
 CheckEntryTextViewMisMatch();
 setModified();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: extensions/source extensions/uiconfig extensions/UIConfig_sbibliography.mk

2021-02-23 Thread Caolán McNamara (via logerrit)
 extensions/UIConfig_sbibliography.mk   |1 
 extensions/source/bibliography/toolbar.cxx |   44 +
 extensions/source/bibliography/toolbar.hxx |5 +
 extensions/uiconfig/sbibliography/ui/autofiltermenu.ui |9 +++
 4 files changed, 38 insertions(+), 21 deletions(-)

New commits:
commit b627cb4e9af7dbb43dfc41adfc549c67dd1756c5
Author: Caolán McNamara 
AuthorDate: Tue Feb 23 14:12:46 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 23 20:18:21 2021 +0100

weld bibliography autofilter menu

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

diff --git a/extensions/UIConfig_sbibliography.mk 
b/extensions/UIConfig_sbibliography.mk
index cf4835829262..7b4056380912 100644
--- a/extensions/UIConfig_sbibliography.mk
+++ b/extensions/UIConfig_sbibliography.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UIConfig_add_menubarfiles,modules/sbibliography,\
 ))
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/sbibliography,\
+   extensions/uiconfig/sbibliography/ui/autofiltermenu \
extensions/uiconfig/sbibliography/ui/choosedatasourcedialog \
extensions/uiconfig/sbibliography/ui/combobox \
extensions/uiconfig/sbibliography/ui/editbox \
diff --git a/extensions/source/bibliography/toolbar.cxx 
b/extensions/source/bibliography/toolbar.cxx
index ea8ae0eeaee8..5ef3a8d5030c 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -34,9 +34,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 
 #include "bibtools.hxx"
@@ -228,9 +228,9 @@ BibToolBar::BibToolBar(vcl::Window* pParent, 
Link aLink)
 , pLbSource(xSource->get_widget())
 , xQuery(VclPtr::Create(this))
 , pEdQuery(xQuery->get_widget())
-, pPopupMenu(VclPtr::Create())
+, xBuilder(Application::CreateBuilder(nullptr, 
"modules/sbibliography/ui/autofiltermenu.ui"))
+, xPopupMenu(xBuilder->weld_menu("menu"))
 , nMenuId(0)
-, nSelMenuItem(0)
 , aLayoutManager(aLink)
 , nSymbolsSize(SFX_SYMBOLS_SIZE_SMALL)
 {
@@ -280,6 +280,8 @@ void BibToolBar::dispose()
 xQuery.disposeAndClear();
 pLbSource = nullptr;
 xSource.disposeAndClear();
+xPopupMenu.reset();
+xBuilder.reset();
 ToolBox::dispose();
 }
 
@@ -411,21 +413,23 @@ void BibToolBar::Click()
 
 void BibToolBar::ClearFilterMenu()
 {
-pPopupMenu->Clear();
+xPopupMenu->clear();
 nMenuId=0;
 }
-sal_uInt16 BibToolBar::InsertFilterItem(const OUString& aMenuEntry)
+
+sal_uInt16 BibToolBar::InsertFilterItem(const OUString& rMenuEntry)
 {
 nMenuId++;
-pPopupMenu->InsertItem(nMenuId,aMenuEntry);
-
+xPopupMenu->append_check(OUString::number(nMenuId), rMenuEntry);
 return nMenuId;
 }
-void BibToolBar::SelectFilterItem(sal_uInt16nId)
+
+void BibToolBar::SelectFilterItem(sal_uInt16 nId)
 {
-pPopupMenu->CheckItem(nId);
-nSelMenuItem=nId;
-aQueryField = MnemonicGenerator::EraseAllMnemonicChars( 
pPopupMenu->GetItemText(nId) );
+OString sId = OString::number(nId);
+xPopupMenu->set_active(sId, true);
+sSelMenuItem = sId;
+aQueryField = 
MnemonicGenerator::EraseAllMnemonicChars(xPopupMenu->get_label(sId));
 }
 
 void BibToolBar::EnableSourceList(bool bFlag)
@@ -510,24 +514,26 @@ IMPL_LINK_NOARG( BibToolBar, SendSelHdl, Timer*, void )
 SendDispatch(nTBC_SOURCE, aPropVal);
 }
 
-IMPL_LINK_NOARG( BibToolBar, MenuHdl, ToolBox*, void)
+IMPL_LINK_NOARG(BibToolBar, MenuHdl, ToolBox*, void)
 {
-sal_uInt16  nId=GetCurItemId();
+sal_uInt16 nId = GetCurItemId();
 if (nId != nTBC_BT_AUTOFILTER)
 return;
 
 EndSelection(); // before SetDropMode (SetDropMode calls SetItemImage)
 
 SetItemDown(nTBC_BT_AUTOFILTER, true);
-nId = pPopupMenu->Execute(this, GetItemRect(nTBC_BT_AUTOFILTER));
 
+tools::Rectangle aRect(GetItemRect(nTBC_BT_AUTOFILTER));
+weld::Window* pParent = weld::GetPopupParent(*this, aRect);
+OString sId = xPopupMenu->popup_at_rect(pParent, aRect);
 
-if(nId>0)
+if (!sId.isEmpty())
 {
-pPopupMenu->CheckItem(nSelMenuItem,false);
-pPopupMenu->CheckItem(nId);
-nSelMenuItem=nId;
-aQueryField = MnemonicGenerator::EraseAllMnemonicChars( 
pPopupMenu->GetItemText(nId) );
+xPopupMenu->set_active(sSelMenuItem, false);
+xPopupMenu->set_active(sId, true);
+sSelMenuItem = sId;
+aQueryField = 
MnemonicGenerator::EraseAllMnemonicChars(xPopupMenu->get_label(sId));
 Sequence aPropVal(2);
 PropertyValue* pPropertyVal = 
const_cast(aPropVal.getConstArray());
 pPropertyVal[0].Name = "QueryText";
diff --git a/extensions/source/bibliography/toolbar.hxx 
b/extensions/source/bibliography/toolbar.hxx
index afd1bd3ace38..ee4b58274e9e 100644
--- 

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

2021-02-22 Thread Caolán McNamara (via logerrit)
 extensions/source/bibliography/general.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dec32864a61104001cb6ff63c218ea5fb2a7ab1e
Author: Caolán McNamara 
AuthorDate: Mon Feb 22 09:26:15 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 22 11:51:33 2021 +0100

cid#1473244 silence Unchecked return value

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

diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index 5cadd05bc3a2..1b712259f80a 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -344,7 +344,7 @@ IMPL_LINK(BibGeneralPage, LastElementKeyInputHdl, const 
KeyEvent&, rKeyEvent, bo
 xUpdateCursor->moveToInsertRow();
 }
 else
-xRowSet->next();
+(void)xRowSet->next();
 }
 xIdentifierED->grab_focus();
 xIdentifierED->select_region(0, -1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-22 Thread Noel (via logerrit)
 extensions/source/bibliography/toolbar.cxx   |4 +--
 extensions/source/propctrlr/formcomponenthandler.cxx |   10 -
 extensions/source/propctrlr/propcontroller.cxx   |   20 +--
 extensions/source/scanner/scanunx.cxx|5 +---
 4 files changed, 19 insertions(+), 20 deletions(-)

New commits:
commit 7be139f114f5f14588e06f8224b0b978db833de2
Author: Noel 
AuthorDate: Sun Feb 21 20:02:40 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 10:16:08 2021 +0100

loplugin:refcounting in extensions

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

diff --git a/extensions/source/bibliography/toolbar.cxx 
b/extensions/source/bibliography/toolbar.cxx
index ae054801d8db..ea8ae0eeaee8 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -295,8 +295,8 @@ void BibToolBar::InitListener()
 util::URL aQueryURL;
 aQueryURL.Complete = ".uno:Bib/MenuFilter";
 xTrans->parseStrict( aQueryURL);
-BibToolBarListener* pQuery=new BibTBQueryMenuListener(this, 
aQueryURL.Complete, nTBC_BT_AUTOFILTER);
-xDisp->addStatusListener(uno::Reference< frame::XStatusListener > 
(pQuery),aQueryURL);
+rtl::Reference pQuery=new BibTBQueryMenuListener(this, 
aQueryURL.Complete, nTBC_BT_AUTOFILTER);
+xDisp->addStatusListener(pQuery, aQueryURL);
 
 for(ToolBox::ImplToolItems::size_type nPos=0;nPos 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/urlcontrol.ui",
 m_xContext));
 auto pURLBox = 
std::make_unique(xBuilder->weld_combo_box("urlcontrol"));
-auto pControl = new OFileUrlControl(std::move(pURLBox), 
std::move(xBuilder), false);
+rtl::Reference pControl = new 
OFileUrlControl(std::move(pURLBox), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 aDescriptor.Control = pControl;
 
@@ -1095,7 +1095,7 @@ namespace pcr
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/formattedsample.ui",
 m_xContext));
 auto pContainer = 
xBuilder->weld_container("formattedsample");
-auto pControl = new 
OFormatSampleControl(std::move(pContainer), std::move(xBuilder), false);
+rtl::Reference pControl = new 
OFormatSampleControl(std::move(pContainer), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 
 pControl->SetFormatSupplier(pSupplier);
@@ -1110,7 +1110,7 @@ namespace pcr
 auto pSpinButton = 
xBuilder->weld_formatted_spin_button("formattedcontrol");
 // for ui-testing try and distinguish different 
instances of this formatted control
 
pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() + "-" + 
aDescriptor.DisplayName.toUtf8());
-auto pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
+rtl::Reference pControl = 
new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), 
false);
 pControl->SetModifyHandler();
 
 FormatDescription aDesc;
@@ -1151,7 +1151,7 @@ namespace pcr
 auto pSpinButton = 
xBuilder->weld_formatted_spin_button("formattedcontrol");
 // for ui-testing try and distinguish different instances of this 
formatted control
 pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() 
+ "-" + aDescriptor.DisplayName.toUtf8());
-auto pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
+rtl::Reference pControl = new 
OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false);
 pControl->SetModifyHandler();
 aDescriptor.Control = pControl;
 
@@ -1285,7 +1285,7 @@ namespace pcr
 {
 std::unique_ptr 
xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/numericfield.ui",
 m_xContext));
 auto pSpinButton = 
xBuilder->weld_metric_spin_button("numericfield", FieldUnit::MILLISECOND);
-auto pControl = new ONumericControl(std::move(pSpinButton), 
std::move(xBuilder), bReadOnly);
+rtl::Reference pControl = new 
ONumericControl(std::move(pSpinButton), std::move(xBuilder), bReadOnly);
 pControl->SetModifyHandler();
 pControl->setMinValue( Optional< double >( true, 0 ) );
 pControl->setMaxValue( Optional< double >( true, 
std::numeric_limits< double >::max() ) );
diff --git a/extensions/source/propctrlr/propcontroller.cxx 

[Libreoffice-commits] core.git: extensions/source extensions/uiconfig solenv/sanitizers

2021-02-19 Thread Caolán McNamara (via logerrit)
 extensions/source/bibliography/bibview.cxx  |   40 
 extensions/source/bibliography/bibview.hxx  |4 
 extensions/source/bibliography/general.cxx  | 1036 +---
 extensions/source/bibliography/general.hxx  |  229 +---
 extensions/uiconfig/sbibliography/ui/generalpage.ui |  694 +
 solenv/sanitizers/ui/modules/sbibliography.suppr|   31 
 6 files changed, 1088 insertions(+), 946 deletions(-)

New commits:
commit ce5cf53a661a4083c1f2eb1c341c32e7e3cdde8a
Author: Caolán McNamara 
AuthorDate: Wed Feb 17 15:42:28 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 19 10:08:42 2021 +0100

weld BibGeneralPage

go the route of all-welded to replace this mix of vcl and awt
widgets

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

diff --git a/extensions/source/bibliography/bibview.cxx 
b/extensions/source/bibliography/bibview.cxx
index e4eca459631e..09925e6c4ca4 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -79,38 +79,11 @@ namespace bib
 {
 VclPtr pGeneralPage = m_pGeneralPage;
 m_pGeneralPage.clear();
-
-pGeneralPage->CommitActiveControl();
-Reference< XForm > xForm = m_pDatMan->getForm();
-Reference< XPropertySet > xProps( xForm, UNO_QUERY );
-Reference< sdbc::XResultSetUpdate > xResUpd( xProps, UNO_QUERY );
-DBG_ASSERT( xResUpd.is(), "BibView::~BibView: invalid form!" );
-
-if ( xResUpd.is() )
-{
-Any aModified = xProps->getPropertyValue( "IsModified" );
-bool bFlag = false;
-if ( ( aModified >>= bFlag ) && bFlag )
-{
-
-try
-{
-Any aNew = xProps->getPropertyValue( "IsNew" );
-aNew >>= bFlag;
-if ( bFlag )
-xResUpd->insertRow();
-else
-xResUpd->updateRow();
-}
-catch( const uno::Exception&) {}
-}
-}
+pGeneralPage.disposeAndClear(); // dispose will commit any uncommitted 
weld::Entry changes
 
 if ( m_aFormControlContainer.isFormConnected() )
 m_aFormControlContainer.disconnectForm();
 
-pGeneralPage->RemoveListeners();
-pGeneralPage.disposeAndClear();
 BibWindow::dispose();
 }
 
@@ -122,7 +95,6 @@ namespace bib
 if ( m_pGeneralPage )
 {
 m_pGeneralPage->Hide();
-m_pGeneralPage->RemoveListeners();
 m_pGeneralPage.disposeAndClear();
 }
 
@@ -198,15 +170,7 @@ namespace bib
 
 Reference< awt::XControlContainer > 
BibViewFormControlContainer::getControlContainer()
 {
-return mpBibView->getControlContainer();
-}
-
-Reference< awt::XControlContainer > BibView::getControlContainer() const
-{
-Reference< awt::XControlContainer > xReturn;
-if ( m_pGeneralPage )
-xReturn = m_pGeneralPage->GetControlContainer();
-return xReturn;
+return nullptr;
 }
 
 void BibView::GetFocus()
diff --git a/extensions/source/bibliography/bibview.hxx 
b/extensions/source/bibliography/bibview.hxx
index 4198dac03987..00060f7d34ad 100644
--- a/extensions/source/bibliography/bibview.hxx
+++ b/extensions/source/bibliography/bibview.hxx
@@ -28,11 +28,8 @@ class   BibDataManager;
 
 namespace com::sun::star::awt{ class XFocusListener;}
 
-
 namespace bib
 {
-
-
 class BibView;
 class BibViewFormControlContainer : public FormControlContainer
 {
@@ -73,7 +70,6 @@ namespace bib
 virtual voiddispose() override;
 
 voidUpdatePages();
-css::uno::Reference< css::awt::XControlContainer > 
getControlContainer() const;
 
 virtual voidGetFocus() override;
 
diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index 479aa7be18b8..5cadd05bc3a2 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -26,10 +27,9 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
-#include 
 #include "general.hxx"
 #include "bibresid.hxx"
 #include "datman.hxx"
@@ -40,7 +40,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -65,159 +64,76 @@ static OUString lcl_GetColumnName( const Mapping* 
pMapping, sal_uInt16 nIndexPos
 return sRet;
 }
 
-namespace {
-
-class BibPosListener:public cppu::WeakImplHelper 
-{
-VclPtr pParentPage;
-public:
-explicit BibPosListener(BibGeneralPage* pParent);
-
-//XPositioningListener
-virtual void 

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

2021-02-18 Thread Stephan Bergmann (via logerrit)
 extensions/source/update/check/updatecheckjob.cxx |2 +-
 extensions/source/update/check/updateprotocol.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4adf4e0a5518f6895ca188c7b03ac430a53571e8
Author: Stephan Bergmann 
AuthorDate: Thu Feb 18 15:40:25 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 18 19:01:14 2021 +0100

loplugin:referencecasting (--enable-extension-update)

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

diff --git a/extensions/source/update/check/updatecheckjob.cxx 
b/extensions/source/update/check/updatecheckjob.cxx
index 977e7fbaa12f..82d2f7439ba2 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -314,7 +314,7 @@ extensions_update_UpdateCheckJob_get_implementation(
 css::uno::Reference desktop(
 css::frame::Desktop::create(context));
 rtl::Reference job(new UpdateCheckJob(context, desktop));
-desktop->addTerminateListener(job.get());
+desktop->addTerminateListener(job);
 return cppu::acquire(job.get());
 }
 
diff --git a/extensions/source/update/check/updateprotocol.cxx 
b/extensions/source/update/check/updateprotocol.cxx
index 4417565c4752..a2da6a82c716 100644
--- a/extensions/source/update/check/updateprotocol.cxx
+++ b/extensions/source/update/check/updateprotocol.cxx
@@ -144,7 +144,7 @@ checkForUpdates(
 
 if( aUpdateInfoEnumeration->nextElement() >>= aEntry )
 {
-uno::Reference< xml::dom::XNode > xNode( 
aEntry.UpdateDocument.get() );
+uno::Reference< xml::dom::XNode > xNode( aEntry.UpdateDocument 
);
 uno::Reference< xml::dom::XNodeList > xNodeList;
 try {
 xNodeList = xXPath->selectNodeList(xNode, aXPathExpression
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-11 Thread Caolán McNamara (via logerrit)
 extensions/source/propctrlr/usercontrol.cxx |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 816994a1759e1760e4b55f327a2c957fba3860e0
Author: Caolán McNamara 
AuthorDate: Thu Feb 11 15:52:07 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 11 20:40:48 2021 +0100

tdf#140239 leave current cursor valid if the contents won't change

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

diff --git a/extensions/source/propctrlr/usercontrol.cxx 
b/extensions/source/propctrlr/usercontrol.cxx
index 74390e1fcde2..fbf829b62938 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -241,18 +241,16 @@ namespace pcr
 {
 }
 
-void SAL_CALL OFileUrlControl::setValue( const Any& _rValue )
+void SAL_CALL OFileUrlControl::setValue(const Any& rValue)
 {
 OUString sURL;
-if (  _rValue >>= sURL )
-{
-if (GraphicObject::isGraphicObjectUniqueIdURL(sURL))
-
getTypedControlWindow()->set_entry_text(getTypedControlWindow()->GetPlaceHolder());
-else
-getTypedControlWindow()->set_entry_text(sURL);
-}
-else
-getTypedControlWindow()->set_entry_text( "" );
+SvtURLBox* pControlWindow = getTypedControlWindow();
+bool bSuccess = rValue >>= sURL;
+if (bSuccess && GraphicObject::isGraphicObjectUniqueIdURL(sURL))
+sURL = pControlWindow->GetPlaceHolder();
+// tdf#140239 leave current cursor valid if the contents won't change
+if (sURL != pControlWindow->GetURL())
+pControlWindow->set_entry_text(sURL);
 }
 
 Any SAL_CALL OFileUrlControl::getValue()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-01 Thread Arnaud Versini (via logerrit)
 extensions/source/abpilot/datasourcehandling.cxx |8 ++--
 extensions/source/abpilot/datasourcehandling.hxx |2 --
 2 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 0cf73245e22905114b500f1a2473ae64f3bfef85
Author: Arnaud Versini 
AuthorDate: Sun Jan 31 17:36:55 2021 +0100
Commit: Noel Grandin 
CommitDate: Mon Feb 1 17:47:39 2021 +0100

abpilot : remove useless type PackageAccessControl

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

diff --git a/extensions/source/abpilot/datasourcehandling.cxx 
b/extensions/source/abpilot/datasourcehandling.cxx
index ceb5e90f2515..806acca41f16 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -87,10 +87,6 @@ namespace abp
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::frame;
 
-
-struct PackageAccessControl { };
-
-
 static Reference< XDatabaseContext > lcl_getDataSourceContext( const 
Reference< XComponentContext >& _rxContext )
 {
 Reference xContext = 
DatabaseContext::create(_rxContext);
@@ -149,7 +145,7 @@ namespace abp
 );
 }
 
-aReturn.setDataSource( xNewDataSource, 
_rName,PackageAccessControl() );
+aReturn.setDataSource( xNewDataSource, _rName );
 }
 catch(const Exception&)
 {
@@ -405,7 +401,7 @@ namespace abp
 }
 
 
-void ODataSource::setDataSource( const Reference< XPropertySet >& 
_rxDS,const OUString& _sName, PackageAccessControl )
+void ODataSource::setDataSource( const Reference< XPropertySet >& 
_rxDS,const OUString& _sName )
 {
 if (m_pImpl->xDataSource.get() == _rxDS.get())
 // nothing to do
diff --git a/extensions/source/abpilot/datasourcehandling.hxx 
b/extensions/source/abpilot/datasourcehandling.hxx
index 4f8a0cbc28d7..485c3c15bd90 100644
--- a/extensions/source/abpilot/datasourcehandling.hxx
+++ b/extensions/source/abpilot/datasourcehandling.hxx
@@ -81,7 +81,6 @@ namespace abp
 };
 
 struct ODataSourceImpl;
-struct PackageAccessControl;
 struct AddressSettings;
 /** a non-UNO wrapper for a data source
 This class allows to access data sources without the need to 
compile the respective file with
@@ -174,7 +173,6 @@ namespace abp
 voidsetDataSource(
  const css::uno::Reference< css::beans::XPropertySet >& _rxDS
 ,const OUString& _sName
-,PackageAccessControl
 );
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   6   >