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

2023-10-20 Thread Stephan Bergmann (via logerrit)
 vbahelper/source/msforms/vbamultipage.cxx|2 +-
 vbahelper/source/msforms/vbaprogressbar.cxx  |2 +-
 vbahelper/source/vbahelper/vbaglobalbase.cxx |2 +-
 vbahelper/source/vbahelper/vbahelper.cxx |   16 
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 335e73a7f37f5efc08a6691d8e4b271c68e0a2ac
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:39 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 20 22:46:23 2023 +0200

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

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

diff --git a/vbahelper/source/msforms/vbamultipage.cxx 
b/vbahelper/source/msforms/vbamultipage.cxx
index 183a93b667d4..72f62b665248 100644
--- a/vbahelper/source/msforms/vbamultipage.cxx
+++ b/vbahelper/source/msforms/vbamultipage.cxx
@@ -25,7 +25,7 @@
 using namespace com::sun::star;
 using namespace ooo::vba;
 
-constexpr OUStringLiteral SVALUE( u"MultiPageValue" );
+constexpr OUString SVALUE( u"MultiPageValue"_ustr );
 
 namespace {
 
diff --git a/vbahelper/source/msforms/vbaprogressbar.cxx 
b/vbahelper/source/msforms/vbaprogressbar.cxx
index f988112b5c52..2e6462e4d72b 100644
--- a/vbahelper/source/msforms/vbaprogressbar.cxx
+++ b/vbahelper/source/msforms/vbaprogressbar.cxx
@@ -22,7 +22,7 @@ using namespace com::sun::star;
 using namespace ooo::vba;
 
 // uno servicename com.sun.star.awt.UnoControlProgressBarMode
-constexpr OUStringLiteral SVALUE( u"ProgressValue" );
+constexpr OUString SVALUE( u"ProgressValue"_ustr );
 
 ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< ov::XHelperInterface 
>& xParent, const uno::Reference< uno::XComponentContext >& xContext, const 
uno::Reference< uno::XInterface >& xControl, const uno::Reference< 
frame::XModel >& xModel, std::unique_ptr 
pGeomHelper )
 : ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, 
std::move(pGeomHelper) )
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx 
b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 13273f246060..a8a0d6df3a8d 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -34,7 +34,7 @@ using namespace ooo::vba;
 
 // special key to return the Application
 const char sAppService[] = "ooo.vba.Application";
-constexpr OUStringLiteral gsApplication( u"Application" );
+constexpr OUString gsApplication( u"Application"_ustr );
 
 VbaGlobalsBase::VbaGlobalsBase(
 const uno::Reference< ov::XHelperInterface >& xParent,
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx 
b/vbahelper/source/vbahelper/vbahelper.cxx
index 20fa519dc0d6..0e0c7b9c8f28 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -854,14 +854,14 @@ double UserFormGeometryHelper::getOffsetY() const
 return mfOffsetY;
 }
 
-constexpr OUStringLiteral saPosXName = u"PositionX";
-constexpr OUStringLiteral saPosYName = u"PositionY";
-constexpr OUStringLiteral saWidthName = u"Width";
-constexpr OUStringLiteral saHeightName = u"Height";
+constexpr OUString saPosXName = u"PositionX"_ustr;
+constexpr OUString saPosYName = u"PositionY"_ustr;
+constexpr OUString saWidthName = u"Width"_ustr;
+constexpr OUString saHeightName = u"Height"_ustr;
 
 double UserFormGeometryHelper::implGetPos( bool bPosY ) const
 {
-sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? 
OUString(saPosYName) : OUString(saPosXName) ).get< sal_Int32 >();
+sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? saPosYName 
: saPosXName ).get< sal_Int32 >();
 // appfont to pixel
 awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( 
nPosAppFont, nPosAppFont ), util::MeasureUnit::APPFONT );
 // pixel to VBA points
@@ -876,12 +876,12 @@ void UserFormGeometryHelper::implSetPos( double fPos, 
bool bPosY )
 awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( 
nPosPixel, nPosPixel ), util::MeasureUnit::POINT );
 // pixel to appfont
 awt::Point aPosAppFont = mxUnitConv->convertPointToLogic( aPosPixel, 
util::MeasureUnit::APPFONT );
-mxModelProps->setPropertyValue( bPosY ? OUString(saPosYName) : 
OUString(saPosXName), uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) );
+mxModelProps->setPropertyValue( bPosY ? saPosYName : saPosXName, uno::Any( 
bPosY ? aPosAppFont.Y : aPosAppFont.X ) );
 }
 
 double UserFormGeometryHelper::implGetSize( bool bHeight, bool bOuter ) const
 {
-sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? 
OUString(saHeightName) : OUString(saWidthName) ).get< sal_Int32 >();
+sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? 
saHeightName : saWidthName ).get< sal_Int32 >();
 // appfont to pixel
 awt::Size aSizePixel = mxUnitConv->convertSizeToPixel( awt::Size( 
nSizeAppFont, 

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

2022-10-08 Thread Justin Luth (via logerrit)
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |   18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit e2abb5bbc03cca884fa89345003d013688f0d94d
Author: Justin Luth 
AuthorDate: Fri Oct 7 19:35:59 2022 -0400
Commit: Justin Luth 
CommitDate: Sun Oct 9 01:07:23 2022 +0200

tdf#148806 doc vba: accept module AutoOpen.Main

This is the lowest priority way of running AutoOpen,
and it only applies to Word, not Excel.

There is some code in basic/source/classes/sb.cxx
that was somewhat finding this before it got lost in LO 7.4
with commit beb6c62e990599d91ac5d9183164c94d269027d3.

TODO: these AutoOpens should only run with a public sub,
not a private one.

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

diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx 
b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index dbd345c9bac7..cbe8ca79bad7 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -367,7 +368,22 @@ VbaEventsHelperBase::ModulePathMap& 
VbaEventsHelperBase::updateModulePathMap( co
 {
 const EventHandlerInfo& rInfo = rEventInfo.second;
 if( rInfo.mnModuleType == nModuleType )
-rPathMap[ rInfo.mnEventId ] = resolveVBAMacro( mpShell, 
maLibraryName, rModuleName, rInfo.maMacroName );
+{
+OUString sName = resolveVBAMacro(mpShell, maLibraryName, 
rModuleName,
+ rInfo.maMacroName);
+// Only in Word (with lowest priority), an Auto* module can 
execute a "Public Sub Main"
+if (sName.isEmpty() && rModuleName.isEmpty()
+&& getImplementationName() == "SwVbaEventsHelper")
+{
+if (rInfo.mnEventId == css::script::vba::VBAEventId::AUTO_NEW
+|| rInfo.mnEventId == 
css::script::vba::VBAEventId::AUTO_OPEN
+|| rInfo.mnEventId == 
css::script::vba::VBAEventId::AUTO_CLOSE)
+{
+sName = resolveVBAMacro(mpShell, maLibraryName, 
rInfo.maMacroName, "Main");
+}
+}
+rPathMap[rInfo.mnEventId] = sName;
+}
 }
 return rPathMap;
 }


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

2022-08-05 Thread Mike Kaganski (via logerrit)
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit da9b11a50ac33c70324fe007aa03ca01531abeb3
Author: Mike Kaganski 
AuthorDate: Fri Aug 5 13:41:51 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Aug 5 14:48:17 2022 +0200

Use o3tl::convert in VbaApplicationBase::CentimetersToPoints

Note that the old conversion was incorrect; it likely followed
MS documentation [1], which is inaccurate: running in Word

  MsgBox CentimetersToPoints(1.0)

gives 28.34646 (expected given the 1 in = 72 pt definition).

[1] 
https://docs.microsoft.com/en-us/office/vba/api/word.application.centimeterstopoints

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

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index fe00e0c89739..b3ba3138de28 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -409,9 +409,7 @@ void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& 
aEarliestTime, const O
 
 float SAL_CALL VbaApplicationBase::CentimetersToPoints( float Centimeters )
 {
-// i cm = 28.35 points
-static const float rate = 28.35f;
-return ( Centimeters * rate );
+return o3tl::convert(Centimeters, o3tl::Length::cm, o3tl::Length::pt);
 }
 
 uno::Any SAL_CALL VbaApplicationBase::getVBE()


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

2022-05-31 Thread Stephan Bergmann (via logerrit)
 vbahelper/source/msforms/vbacontrol.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3a06db0af05294e0b5db6f07daf35bec7371d4cc
Author: Stephan Bergmann 
AuthorDate: Tue May 31 15:38:29 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 31 19:14:49 2022 +0200

Use a range-based for loop

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

diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 937793c3ec23..5cbea01a4dd3 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -465,11 +465,11 @@ PointerStyles const styles[] = {
 static tools::Long lcl_loPointerToMsoPointer( PointerStyle eType )
 {
 tools::Long nRet = msforms::fmMousePointer::fmMousePointerDefault;
-for ( int i = 0; i < int(SAL_N_ELEMENTS( styles )); ++i )
+for ( auto const & i: styles )
 {
-if ( styles[ i ].loPointStyle == eType )
+if ( i.loPointStyle == eType )
 {
-nRet = styles[ i ].msoPointerStyle;
+nRet = i.msoPointerStyle;
 break;
 }
 }
@@ -479,11 +479,11 @@ static tools::Long lcl_loPointerToMsoPointer( 
PointerStyle eType )
 static PointerStyle lcl_msoPointerToLOPointer( tools::Long msoPointerStyle )
 {
 PointerStyle aPointer( PointerStyle::Arrow );
-for ( int i = 0; i < int(SAL_N_ELEMENTS( styles )); ++i )
+for ( auto const & i: styles )
 {
-if ( styles[ i ].msoPointerStyle == msoPointerStyle )
+if ( i.msoPointerStyle == msoPointerStyle )
 {
-aPointer = styles[ i ].loPointStyle;
+aPointer = i.loPointStyle;
 break;
 }
 }


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

2021-10-04 Thread Verne-Lai (via logerrit)
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dad5b69b229047e0bba921f1856ce26183a5
Author: Verne-Lai 
AuthorDate: Fri Oct 1 11:09:59 2021 +0800
Commit: Michael Stahl 
CommitDate: Mon Oct 4 11:21:34 2021 +0200

[tdf#42982]Improve runtimeException's Message

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

diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx 
b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index 1396c93cd616..8c8515d8fa1c 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -277,7 +277,7 @@ OUString VbaEventsHelperBase::getEventHandlerPath( const 
EventHandlerInfo& rInfo
 break;
 
 default:
-throw uno::RuntimeException(); // unsupported module type
+throw uno::RuntimeException("This module type is unsupported"); // 
unsupported module type
 }
 
 /*  Performance improvement: Check the list of existing event handlers


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

2021-06-11 Thread Julien Nabet (via logerrit)
 vbahelper/source/msforms/vbalistbox.cxx  |3 +--
 vbahelper/source/vbahelper/vbadialogbase.cxx |3 +--
 vbahelper/source/vbahelper/vbashape.cxx  |   10 ++
 vbahelper/source/vbahelper/vbashapes.cxx |3 +--
 4 files changed, 5 insertions(+), 14 deletions(-)

New commits:
commit 92889bc98f4e822715874cb80346d8370e9da8e6
Author: Julien Nabet 
AuthorDate: Fri Jun 11 13:00:59 2021 +0200
Commit: Julien Nabet 
CommitDate: Fri Jun 11 16:02:57 2021 +0200

Simplify Sequences initializations (vbahelper)

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

diff --git a/vbahelper/source/msforms/vbalistbox.cxx 
b/vbahelper/source/msforms/vbalistbox.cxx
index 8c2ea52332db..9dcef8a77225 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -81,10 +81,9 @@ ScVbaListBox::setValue( const uno::Any& _value )
 if( nValue == -1 )
 throw uno::RuntimeException( "Attribute use invalid." );
 
-uno::Sequence< sal_Int16 > nSelectedIndices(1);
+uno::Sequence< sal_Int16 > nSelectedIndices { nValue };
 uno::Sequence< sal_Int16 > nOldSelectedIndices;
 m_xProps->getPropertyValue( "SelectedItems" ) >>= nOldSelectedIndices;
-nSelectedIndices[ 0 ] = nValue;
 m_xProps->setPropertyValue( "SelectedItems", uno::makeAny( 
nSelectedIndices ) );
 if ( nSelectedIndices != nOldSelectedIndices )
 fireClickEvent();
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx 
b/vbahelper/source/vbahelper/vbadialogbase.cxx
index a1aa0b053436..9b9087bd264d 100644
--- a/vbahelper/source/vbahelper/vbadialogbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogbase.cxx
@@ -31,8 +31,7 @@ void SAL_CALL VbaDialogBase::Show()
 if (aURL.isEmpty())
 throw uno::RuntimeException("Unable to open the specified dialog");
 
-uno::Sequence dispatchProps(0);
-dispatchRequests(m_xModel, aURL, dispatchProps);
+dispatchRequests(m_xModel, aURL, {});
 }
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbashape.cxx 
b/vbahelper/source/vbahelper/vbashape.cxx
index 8f16865eff8c..67998de7f6f3 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -389,10 +389,7 @@ ScVbaShape::TextFrame()
 if( xServiceInfo->supportsService( 
"com.sun.star.sheet.SpreadsheetDocument" ) )
 {
 uno::Reference< uno::XComponentContext > xContext = 
comphelper::getProcessComponentContext();
-uno::Sequence< uno::Any > aArgs(2);
-aArgs[0] <<= getParent();
-aArgs[1] <<= m_xShape;
-uno::Reference< uno::XInterface > xTextFrame = 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext( 
"ooo.vba.excel.TextFrame" , aArgs, xContext );
+uno::Reference< uno::XInterface > xTextFrame = 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext( 
"ooo.vba.excel.TextFrame" , { uno::Any(getParent()), uno::Any(m_xShape) }, 
xContext );
 return uno::makeAny( xTextFrame );
 }
 
@@ -726,10 +723,7 @@ ScVbaShape::WrapFormat()
 if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ))
 {
 uno::Reference< uno::XComponentContext > xContext = 
comphelper::getProcessComponentContext();
-uno::Sequence< uno::Any > aArgs(2);
-aArgs[0] <<= getParent();
-aArgs[1] <<= m_xShape;
-uno::Reference< uno::XInterface > xWrapFormat = 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext( 
"ooo.vba.word.WrapFormat" , aArgs, xContext );
+uno::Reference< uno::XInterface > xWrapFormat = 
xContext->getServiceManager()->createInstanceWithArgumentsAndContext( 
"ooo.vba.word.WrapFormat" ,{ uno::Any(getParent()), uno::Any(m_xShape) }, 
xContext );
 return uno::makeAny( xWrapFormat );
 }
 throw uno::RuntimeException( "Not implemented" );
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx 
b/vbahelper/source/vbahelper/vbashapes.cxx
index c14f81791f95..552365da3861 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -180,8 +180,7 @@ ScVbaShapes::Range( const uno::Any& shapes )
 else
 {
 // wrap single index into a sequence
-uno::Sequence< uno::Any > sIndices(1);
-sIndices[ 0 ] = shapes;
+uno::Sequence< uno::Any > sIndices { shapes };
 uno::Any aIndex;
 aIndex <<= sIndices;
 xShapes = getShapesByArrayIndices( aIndex );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-21 Thread Noel Grandin (via logerrit)
 vbahelper/source/vbahelper/vbaglobalbase.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 634e98e767928806852aee6653a6fb6f35328eea
Author: Noel Grandin 
AuthorDate: Fri May 21 13:26:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri May 21 14:29:09 2021 +0200

fix shutdown leak VbaGlobalsBase

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

diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx 
b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 82808161e154..0e1dcf2b178a 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -95,6 +96,9 @@ VbaGlobalsBase::~VbaGlobalsBase()
 // release application reference, as it is holding onto the context
 xNameContainer->removeByName( gsApplication );
 }
+uno::Reference< lang::XComponent > xComponent( mxContext, 
uno::UNO_QUERY );
+if (xComponent)
+xComponent->dispose();
 }
 catch ( const uno::Exception& )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-19 Thread Noel (via logerrit)
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |7 ---
 vbahelper/source/vbahelper/vbashapes.cxx |9 +
 2 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 3f95cbcda193c2e87159ba3e8c137f8a12643c84
Author: Noel 
AuthorDate: Fri Feb 19 11:25:58 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 19 11:29:21 2021 +0100

loplugin:refcounting in vbahelper

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

diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx 
b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 643c4aa71445..1b35964446b0 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -19,6 +19,7 @@
 #include "vbacommandbarcontrols.hxx"
 #include "vbacommandbarcontrol.hxx"
 #include 
+#include 
 
 using namespace com::sun::star;
 using namespace ooo::vba;
@@ -132,7 +133,7 @@ ScVbaCommandBarControls::createCollectionObject( const 
uno::Any& aSource )
 m_xIndexAccess->getByIndex( nPosition ) >>= aProps;
 uno::Reference< container::XIndexAccess > xSubMenu;
 getPropertyValue( aProps, ITEM_DESCRIPTOR_CONTAINER ) >>= xSubMenu;
-ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
+rtl::Reference pNewCommandBarControl;
 if( xSubMenu.is() )
 pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, 
m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
 else
@@ -220,13 +221,13 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const 
uno::Any& Id, const un
 
 pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 
-ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
+rtl::Reference pNewCommandBarControl;
 if( nType == office::MsoControlType::msoControlPopup )
 pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, 
m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
 else
 pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, 
m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
 
-return uno::Reference< XCommandBarControl >( pNewCommandBarControl );
+return pNewCommandBarControl;
 }
 
 // XHelperInterface
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx 
b/vbahelper/source/vbahelper/vbashapes.cxx
index 118082fa9667..c14f81791f95 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
@@ -238,7 +239,7 @@ ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 
startY, sal_Int32 nLineWid
 size.Width = nWidth;
 xShape->setSize( size );
 
-ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, 
m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+rtl::Reference pScVbaShape = new ScVbaShape( getParent(), 
mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
 return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
 }
 
@@ -280,7 +281,7 @@ ScVbaShapes::AddEllipse(sal_Int32 startX, sal_Int32 startY, 
sal_Int32 nLineWidth
 size.Width = nWidth;
 xShape->setSize(size);
 
-ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, 
m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+rtl::Reference pScVbaShape = new ScVbaShape( getParent(), 
mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
 return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
 }
 
@@ -315,7 +316,7 @@ ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, 
sal_Int32 endX, sal_In
 size.Width = nWidth;
 xShape->setSize(size);
 
-ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, 
m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+rtl::Reference pScVbaShape = new ScVbaShape( getParent(), 
mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
 return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
 }
 
@@ -382,7 +383,7 @@ ScVbaShapes::AddTextboxInWriter( sal_Int32 _nLeft, 
sal_Int32 _nTop, sal_Int32 _n
 xShapeProps->setPropertyValue( "LayerName", uno::makeAny( 
OUString("Heaven") ) );
 
 
-ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, 
m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
+rtl::Reference pScVbaShape = new ScVbaShape( getParent(), 
mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
 return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2020-11-05 Thread Noel (via logerrit)
 vbahelper/source/msforms/vbacontrols.cxx|5 ++---
 vbahelper/source/vbahelper/vbadialogbase.cxx|3 +--
 vbahelper/source/vbahelper/vbapagesetupbase.cxx |8 
 3 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 349099b4e0fa59c3f340d3a1fb175db04220708a
Author: Noel 
AuthorDate: Thu Nov 5 11:22:20 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 5 13:50:05 2020 +0100

loplugin:reducevarscope in vbahelper

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

diff --git a/vbahelper/source/msforms/vbacontrols.cxx 
b/vbahelper/source/msforms/vbacontrols.cxx
index 7c56bd2bbff4..2b7c92374fcf 100644
--- a/vbahelper/source/msforms/vbacontrols.cxx
+++ b/vbahelper/source/msforms/vbacontrols.cxx
@@ -424,11 +424,10 @@ uno::Any SAL_CALL ScVbaControls::Add( const uno::Any& 
Object, const uno::Any& St
 
 void SAL_CALL ScVbaControls::Remove( const uno::Any& StringKeyOrIndex )
 {
-OUString aControlName;
-sal_Int32 nIndex = -1;
-
 try
 {
+OUString aControlName;
+sal_Int32 nIndex = -1;
 if ( !mxDialog.is() )
 throw uno::RuntimeException();
 
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx 
b/vbahelper/source/vbahelper/vbadialogbase.cxx
index 605a9c76f7eb..6e5ae97857b1 100644
--- a/vbahelper/source/vbahelper/vbadialogbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogbase.cxx
@@ -25,10 +25,9 @@ using namespace ::com::sun::star;
 
 void SAL_CALL VbaDialogBase::Show()
 {
-OUString aURL;
 if ( m_xModel.is() )
 {
-aURL = mapIndexToName( mnIndex );
+OUString aURL = mapIndexToName( mnIndex );
 if( aURL.isEmpty() )
 throw uno::RuntimeException( "Unable to open the specified dialog" 
);
 
diff --git a/vbahelper/source/vbahelper/vbapagesetupbase.cxx 
b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
index c29b166c69ca..d50fe188c193 100644
--- a/vbahelper/source/vbahelper/vbapagesetupbase.cxx
+++ b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
@@ -38,7 +38,6 @@ double SAL_CALL VbaPageSetupBase::getTopMargin()
 try
 {
 bool headerOn = false;
-sal_Int32 headerHeight = 0;
 
 uno::Any aValue = mxPageProps->getPropertyValue( "HeaderIsOn" );
 aValue >>= headerOn;
@@ -48,6 +47,7 @@ double SAL_CALL VbaPageSetupBase::getTopMargin()
 
 if( headerOn )
 {
+sal_Int32 headerHeight = 0;
 aValue = mxPageProps->getPropertyValue( "HeaderHeight" );
 aValue >>= headerHeight;
 topMargin = topMargin + headerHeight;
@@ -67,13 +67,13 @@ void SAL_CALL VbaPageSetupBase::setTopMargin( double margin 
)
 try
 {
 bool headerOn = false;
-sal_Int32 headerHeight = 0;
 
 uno::Any aValue = mxPageProps->getPropertyValue( "HeaderIsOn" );
 aValue >>= headerOn;
 
 if( headerOn )
 {
+sal_Int32 headerHeight = 0;
 aValue = mxPageProps->getPropertyValue( "HeaderHeight" );
 aValue >>= headerHeight;
 topMargin -= headerHeight;
@@ -93,7 +93,6 @@ double SAL_CALL VbaPageSetupBase::getBottomMargin()
 try
 {
 bool footerOn = false;
-sal_Int32 footerHeight = 0;
 
 uno::Any aValue = mxPageProps->getPropertyValue( "FooterIsOn" );
 aValue >>= footerOn;
@@ -103,6 +102,7 @@ double SAL_CALL VbaPageSetupBase::getBottomMargin()
 
 if( footerOn )
 {
+sal_Int32 footerHeight = 0;
 aValue = mxPageProps->getPropertyValue( "FooterHeight" );
 aValue >>= footerHeight;
 bottomMargin += footerHeight;
@@ -122,13 +122,13 @@ void SAL_CALL VbaPageSetupBase::setBottomMargin( double 
margin )
 try
 {
 bool footerOn = false;
-sal_Int32 footerHeight = 0;
 
 uno::Any aValue = mxPageProps->getPropertyValue( "FooterIsOn" );
 aValue >>= footerOn;
 
 if( footerOn )
 {
+sal_Int32 footerHeight = 0;
 aValue = mxPageProps->getPropertyValue( "FooterHeight" );
 aValue >>= footerHeight;
 bottomMargin -= footerHeight;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-21 Thread Andrea Gelmini (via logerrit)
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 857c09a250c39185ea9138d3a5b3bac7dc899091
Author: Andrea Gelmini 
AuthorDate: Thu Aug 20 13:05:32 2020 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 21 15:23:16 2020 +0200

Fix typo in code

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

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 286b38bd4b88..924396a962da 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -82,7 +82,7 @@ public:
 return static_cast(nDiffDays) + 
static_cast(nDiffSeconds)/double(24*3600);
 }
 
-static sal_Int32 GetTimerMiliseconds( double nFrom, double nTo )
+static sal_Int32 GetTimerMilliseconds( double nFrom, double nTo )
 {
 double nResult = nTo - nFrom;
 if ( nResult > 0 )
@@ -101,7 +101,7 @@ public:
 m_xBase = xBase;
 m_aTimerInfo = VbaTimerInfo( aFunction, ::std::pair< double, double >( 
nFrom, nTo ) );
 m_aTimer.SetInvokeHandler( LINK( this, VbaTimer, MacroCallHdl ) );
-m_aTimer.SetTimeout( GetTimerMiliseconds( GetNow(), nFrom ) );
+m_aTimer.SetTimeout( GetTimerMilliseconds( GetNow(), nFrom ) );
 m_aTimer.Start();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-03 Thread Noel Grandin (via logerrit)
 vbahelper/source/msforms/vbacombobox.cxx   |   26 +++---
 vbahelper/source/msforms/vbalistbox.cxx|   28 +++---
 vbahelper/source/msforms/vbalistcontrolhelper.cxx  |   90 ++---
 vbahelper/source/msforms/vbauserform.cxx   |   22 ++---
 vbahelper/source/vbahelper/vbadocumentbase.cxx |   68 +++
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |4 
 vbahelper/source/vbahelper/vbaglobalbase.cxx   |   38 
 vbahelper/source/vbahelper/vbahelper.cxx   |   20 ++--
 8 files changed, 149 insertions(+), 147 deletions(-)

New commits:
commit 5ec8d154bf0b01ee8f338b89eb5c1369b33b86da
Author: Noel Grandin 
AuthorDate: Sun Aug 2 20:08:42 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 3 09:22:08 2020 +0200

loplugin:flatten in vbahelper

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

diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index 07c937ccbb05..dc10964bf3cf 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -66,21 +66,21 @@ void SAL_CALL
 ScVbaComboBox::setListIndex( const uno::Any& _value )
 {
 sal_Int16 nIndex = 0;
-if( _value >>= nIndex )
+if( !(_value >>= nIndex) )
+return;
+
+sal_Int32 nOldIndex = -1;
+getListIndex() >>= nOldIndex;
+uno::Sequence< OUString > sItems;
+m_xProps->getPropertyValue( "StringItemList" ) >>= sItems;
+if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) )
 {
-sal_Int32 nOldIndex = -1;
-getListIndex() >>= nOldIndex;
-uno::Sequence< OUString > sItems;
-m_xProps->getPropertyValue( "StringItemList" ) >>= sItems;
-if( ( nIndex >= 0 ) && ( sItems.getLength() > nIndex ) )
-{
-OUString sText = sItems[ nIndex ];
-m_xProps->setPropertyValue( "Text", uno::makeAny( sText ) );
+OUString sText = sItems[ nIndex ];
+m_xProps->setPropertyValue( "Text", uno::makeAny( sText ) );
 
-// fire the _Change event
-if( nOldIndex != nIndex )
-fireClickEvent();
-}
+// fire the _Change event
+if( nOldIndex != nIndex )
+fireClickEvent();
 }
 }
 
diff --git a/vbahelper/source/msforms/vbalistbox.cxx 
b/vbahelper/source/msforms/vbalistbox.cxx
index f4af24a5b34f..8c2ea52332db 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -200,22 +200,22 @@ ScVbaListBox::setValueEvent( const uno::Any& value )
 return;
 }
 }
-if( bValue )
+if( !bValue )
+return;
+
+if( getMultiSelect() )
 {
-if( getMultiSelect() )
-{
-nList.realloc( nLength + 1 );
-nList[nLength] = nIndex;
-}
-else
-{
-nList.realloc( 1 );
-nList[0] = nIndex;
-}
-//m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
-fireClickEvent();
-m_xProps->setPropertyValue( "SelectedItems", uno::makeAny( nList ) );
+nList.realloc( nLength + 1 );
+nList[nLength] = nIndex;
+}
+else
+{
+nList.realloc( 1 );
+nList[0] = nIndex;
 }
+//m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
+fireClickEvent();
+m_xProps->setPropertyValue( "SelectedItems", uno::makeAny( nList ) );
 }
 
 // this is called when something like the following vba code is used
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx 
b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
index 07187e56b621..58884dbf62fc 100644
--- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
@@ -88,47 +88,47 @@ uno::Any ListPropListener::getValueEvent()
 void
 ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& 
pvargIndex )
 {
-if ( pvargItem.hasValue()  )
-{
-uno::Sequence< OUString > sList;
-m_xProps->getPropertyValue( "StringItemList" ) >>= sList;
+if ( !pvargItem.hasValue()  )
+return;
 
-sal_Int32 nIndex = sList.getLength();
+uno::Sequence< OUString > sList;
+m_xProps->getPropertyValue( "StringItemList" ) >>= sList;
 
-if ( pvargIndex.hasValue() )
-pvargIndex >>= nIndex;
+sal_Int32 nIndex = sList.getLength();
 
-OUString sString = getAnyAsString( pvargItem );
+if ( pvargIndex.hasValue() )
+pvargIndex >>= nIndex;
 
-// if no index specified or item is to be appended to end of
-// list just realloc the array and set the last item
-if ( nIndex  == sList.getLength() )
-{
-sal_Int32 nOldSize = sList.getLength();
-sList.realloc( nOldSize + 1 );
-

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

2020-07-02 Thread Stephan Bergmann (via logerrit)
 vbahelper/source/vbahelper/vbacommandbarhelper.hxx |   26 ++---
 vbahelper/source/vbahelper/vbaglobalbase.cxx   |2 -
 vbahelper/source/vbahelper/vbahelper.cxx   |8 +++---
 3 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit f0d4f96a0c7c84ea6f81e14f9df1ca37be54db04
Author: Stephan Bergmann 
AuthorDate: Thu Jul 2 12:17:26 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 2 17:00:46 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: vbahelper

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

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
index 545dc7318fc0..4bd627998897 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
@@ -27,21 +27,21 @@
 #include 
 #include 
 
-static const char ITEM_DESCRIPTOR_COMMANDURL[]  = "CommandURL";
-static const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL";
-static const char ITEM_DESCRIPTOR_CONTAINER[]   = "ItemDescriptorContainer";
-static const char ITEM_DESCRIPTOR_LABEL[]   = "Label";
-static const char ITEM_DESCRIPTOR_TYPE[]= "Type";
-static const char ITEM_DESCRIPTOR_STYLE[]   = "Style";
-static const char ITEM_DESCRIPTOR_ISVISIBLE[]   = "IsVisible";
-static const char ITEM_DESCRIPTOR_UINAME[]  = "UIName";
-static const char ITEM_DESCRIPTOR_ENABLED[] = "Enabled";
+const char ITEM_DESCRIPTOR_COMMANDURL[]  = "CommandURL";
+const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL";
+const char ITEM_DESCRIPTOR_CONTAINER[]   = "ItemDescriptorContainer";
+const char ITEM_DESCRIPTOR_LABEL[]   = "Label";
+const char ITEM_DESCRIPTOR_TYPE[]= "Type";
+const char ITEM_DESCRIPTOR_STYLE[]   = "Style";
+const char ITEM_DESCRIPTOR_ISVISIBLE[]   = "IsVisible";
+const char ITEM_DESCRIPTOR_UINAME[]  = "UIName";
+const char ITEM_DESCRIPTOR_ENABLED[] = "Enabled";
 
-static const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
-static const char ITEM_TOOLBAR_URL[] = "private:resource/toolbar/";
+const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
+const char ITEM_TOOLBAR_URL[] = "private:resource/toolbar/";
 
-static const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
-static const char CUSTOM_MENU_STR[] = "vnd.openoffice.org:CustomMenu";
+const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
+const char CUSTOM_MENU_STR[] = "vnd.openoffice.org:CustomMenu";
 
 class VbaCommandBarHelper;
 typedef std::shared_ptr< VbaCommandBarHelper > VbaCommandBarHelperRef;
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx 
b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 902c07d82ffb..ba7e6425106e 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -33,7 +33,7 @@ using namespace ooo::vba;
 
 // special key to return the Application
 const char sAppService[] = "ooo.vba.Application";
-static const OUStringLiteral gsApplication( "Application" );
+const OUStringLiteral gsApplication( "Application" );
 
 VbaGlobalsBase::VbaGlobalsBase(
 const uno::Reference< ov::XHelperInterface >& xParent,
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx 
b/vbahelper/source/vbahelper/vbahelper.cxx
index f99701866e3d..7071a1b90b37 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -851,10 +851,10 @@ double UserFormGeometryHelper::getOffsetY() const
 }
 
 
-static const char saPosXName[] = "PositionX";
-static const char saPosYName[] = "PositionY";
-static const char saWidthName[] = "Width";
-static const char saHeightName[] = "Height";
+const char saPosXName[] = "PositionX";
+const char saPosYName[] = "PositionY";
+const char saWidthName[] = "Width";
+const char saHeightName[] = "Height";
 
 double UserFormGeometryHelper::implGetPos( bool bPosY ) const
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vbahelper/source vcl/inc vcl/source vcl/unx writerfilter/source

2020-05-10 Thread Noel Grandin (via logerrit)
 vbahelper/source/msforms/service.hxx  |2 
 vcl/inc/configsettings.hxx|2 
 vcl/inc/factory.hxx   |4 -
 vcl/inc/graphic/UnoGraphicDescriptor.hxx  |2 
 vcl/inc/implimagetree.hxx |4 -
 vcl/inc/unx/gtk/gtkdata.hxx   |2 
 vcl/inc/unx/salinst.h |4 -
 vcl/inc/window.h  |   60 +++---
 vcl/source/filter/jpeg/jpeg.h |4 -
 vcl/unx/gtk3/a11y/atkwrapper.hxx  |4 -
 writerfilter/source/dmapper/ConversionHelper.hxx  |5 +
 writerfilter/source/dmapper/DomainMapper.hxx  |4 -
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |4 -
 writerfilter/source/dmapper/GraphicImport.hxx |4 -
 writerfilter/source/dmapper/OLEHandler.hxx|4 -
 writerfilter/source/dmapper/PropertyMap.hxx   |4 -
 writerfilter/source/dmapper/SettingsTable.hxx |8 +-
 writerfilter/source/dmapper/StyleSheetTable.hxx   |4 -
 writerfilter/source/dmapper/TDefTableHandler.hxx  |4 -
 19 files changed, 64 insertions(+), 65 deletions(-)

New commits:
commit 8fcd2db54af770d04be5c70b726cd14aff288683
Author: Noel Grandin 
AuthorDate: Sun May 3 13:24:33 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun May 10 20:48:36 2020 +0200

use compact namespace syntax

mostly done using
git grep -wl namespace
| xargs -P 8 perl -i -pe 
's/namespace\s*([\w:]+)\s*\{\s*namespace\s*/namespace \1::/g'

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

diff --git a/vbahelper/source/msforms/service.hxx 
b/vbahelper/source/msforms/service.hxx
index 94c69b6ac8db..a94d54e3c411 100644
--- a/vbahelper/source/msforms/service.hxx
+++ b/vbahelper/source/msforms/service.hxx
@@ -12,7 +12,7 @@
 
 #include 
 
-namespace comphelper { namespace service_decl { class ServiceDecl; } }
+namespace comphelper::service_decl { class ServiceDecl; }
 
 namespace controlprovider {
 extern comphelper::service_decl::ServiceDecl const serviceDecl;
diff --git a/vcl/inc/configsettings.hxx b/vcl/inc/configsettings.hxx
index 967387499b9d..ea6cf65740e7 100644
--- a/vcl/inc/configsettings.hxx
+++ b/vcl/inc/configsettings.hxx
@@ -25,7 +25,7 @@
 
 #include 
 
-namespace com { namespace sun { namespace star { namespace uno { template 
 class Sequence; } } } }
+namespace com::sun::star::uno { template  class Sequence; }
 
 namespace vcl
 {
diff --git a/vcl/inc/factory.hxx b/vcl/inc/factory.hxx
index 7ddc0c5c2730..54a382aa494c 100644
--- a/vcl/inc/factory.hxx
+++ b/vcl/inc/factory.hxx
@@ -26,13 +26,13 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star {
+namespace com::sun::star {
 namespace lang {
 class XMultiServiceFactory;
 class XSingleServiceFactory;
 }
 namespace uno { class XInterface; }
-} } }
+}
 
 css::uno::Sequence vcl_session_getSupportedServiceNames();
 
diff --git a/vcl/inc/graphic/UnoGraphicDescriptor.hxx 
b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
index 4186cfc43c4b..ad46952ce925 100644
--- a/vcl/inc/graphic/UnoGraphicDescriptor.hxx
+++ b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
@@ -54,7 +54,7 @@
 #define MIMETYPE_VCLGRAPHIC "image/x-vclgraphic"
 
 namespace comphelper { class PropertySetInfo; }
-namespace com { namespace sun { namespace star { namespace io { class 
XInputStream; } } } }
+namespace com::sun::star::io { class XInputStream; }
 
 class Graphic;
 
diff --git a/vcl/inc/implimagetree.hxx b/vcl/inc/implimagetree.hxx
index f5ae99ba7d11..3656b66de70f 100644
--- a/vcl/inc/implimagetree.hxx
+++ b/vcl/inc/implimagetree.hxx
@@ -33,9 +33,9 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star { namespace container {
+namespace com::sun::star::container {
 class XNameAccess;
-
+}
 
 struct ImageRequestParameters
 {
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 6c5dd46fc0b6..2f88ffe8b309 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -35,7 +35,7 @@
 
 #include 
 
-namespace com { namespace sun { namespace star { namespace accessibility { 
class XAccessibleEventListener; } } } }
+namespace com::sun::star::accessibility { class XAccessibleEventListener; }
 
 class GtkSalDisplay;
 class DocumentFocusListener;
diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h
index 05b9f45f72e8..89c9a8ae0731 100644
--- a/vcl/inc/unx/salinst.h
+++ b/vcl/inc/unx/salinst.h
@@ -26,9 +26,9 @@
 
 #include 
 
-namespace com { namespace sun { namespace star { namespace datatransfer {
+namespace com::sun::star::datatransfer {
 namespace clipboard { class XClipboard; }
-} } } }
+}
 
 class SalXLib;
 class X11SalGraphics;
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index f4f4d6b29eb4..02a55afa198a 100644

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

2020-02-20 Thread Burak Bala (via logerrit)
 vbahelper/source/msforms/vbanewfont.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7aaa3109edfc2e1fadc533d4d276ee7c14b80dea
Author: Burak Bala 
AuthorDate: Tue Jan 28 20:00:52 2020 +0300
Commit: Michael Stahl 
CommitDate: Thu Feb 20 10:42:28 2020 +0100

tdf#42982 Make UNO error reporting more descriptive

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

diff --git a/vbahelper/source/msforms/vbanewfont.cxx 
b/vbahelper/source/msforms/vbanewfont.cxx
index 2e7e1efbfb2f..b966d8454a81 100644
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -71,7 +71,7 @@ void SAL_CALL VbaNewFont::setCharset( sal_Int16 nCharset )
 if( (0 <= nCharset) && (nCharset <= SAL_MAX_UINT8) )
 eFontEnc = rtl_getTextEncodingFromWindowsCharset( static_cast< 
sal_uInt8 >( nCharset ) );
 if( eFontEnc == RTL_TEXTENCODING_DONTKNOW )
-throw uno::RuntimeException();
+throw uno::RuntimeException("an unknown or missing encoding");
 mxProps->setPropertyValue( "FontCharset" , uno::Any( static_cast< 
sal_Int16 >( eFontEnc ) ) );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-26 Thread Stephan Bergmann (via logerrit)
 vbahelper/source/msforms/vbacontrol.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 0288c8ffecff4956a52b9147d441979941e8b87f
Author: Stephan Bergmann 
AuthorDate: Sun Jan 26 15:10:03 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Jan 26 17:34:15 2020 +0100

Rephrase cast from sal_Int32 to sal_uInt32

...to avoid false positives with upcoming loplugin:unsignedcompare:

> vbahelper/source/msforms/vbacontrol.cxx:730:12: error: explicit cast from 
'sal_Int32' (aka 'int') to 'sal_uInt32' (aka 'unsigned int') (of equal rank) in 
comparison against 'sal_uInt32': if the cast value is known to be non-negative, 
use o3tl::make_unsigned instead of the cast [loplugin:unsignedcompare]
> if ( ( static_cast(nBackColor) >= sal_uInt32(0x8000) 
) &&
>^
> vbahelper/source/msforms/vbacontrol.cxx:731:12: error: explicit cast from 
'sal_Int32' (aka 'int') to 'sal_uInt32' (aka 'unsigned int') (of equal rank) in 
comparison against 'unsigned long': if the cast value is known to be 
non-negative, use o3tl::make_unsigned instead of the cast 
[loplugin:unsignedcompare]
>  ( static_cast(nBackColor) <= sal_uInt32(0x8000) 
+ SAL_N_ELEMENTS(nSysCols) ) )
>
^~~~

(This is the only case I found where the plugin's heuristics failed.)

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

diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 1e877c66d063..bcbbbdcd446e 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -727,10 +727,11 @@ sal_Int32 ScVbaControl::getBackColor()
 
 void ScVbaControl::setBackColor( sal_Int32 nBackColor )
 {
-if ( ( static_cast(nBackColor) >= sal_uInt32(0x8000) ) &&
- ( static_cast(nBackColor) <= sal_uInt32(0x8000) + 
SAL_N_ELEMENTS(nSysCols) ) )
+auto const col = static_cast(nBackColor);
+if ( ( col >= sal_uInt32(0x8000) ) &&
+ ( col <= sal_uInt32(0x8000) + SAL_N_ELEMENTS(nSysCols) ) )
 {
-nBackColor = nSysCols[ nBackColor & 0x0FF];
+nBackColor = nSysCols[ col & 0x0FF];
 }
 m_xProps->setPropertyValue( "BackgroundColor" , uno::makeAny( 
XLRGBToOORGB( nBackColor ) ) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-08-27 Thread Julien Nabet (via logerrit)
 vbahelper/source/vbahelper/vbacolorformat.cxx |2 +-
 vbahelper/source/vbahelper/vbacolorformat.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1c539c548b662104431e283aa4a62cb81174380b
Author: Julien Nabet 
AuthorDate: Tue Aug 27 20:08:41 2019 +0200
Commit: Julien Nabet 
CommitDate: Wed Aug 28 07:18:11 2019 +0200

Typo: HAPICOLOR_WITHE->HAPICOLOR_WHITE (vbahelper)

Change-Id: I51a43e190345a1e981f9bd524d8b2feaf0eb2521
Reviewed-on: https://gerrit.libreoffice.org/78207
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx 
b/vbahelper/source/vbahelper/vbacolorformat.cxx
index 7c72c65a1eeb..653d0db23a2a 100644
--- a/vbahelper/source/vbahelper/vbacolorformat.cxx
+++ b/vbahelper/source/vbahelper/vbacolorformat.cxx
@@ -27,7 +27,7 @@ sal_Int32
 MsoColorIndices::getColorIndex( sal_Int32 nIndex )
 {
 const static sal_Int32 COLORINDICES[56] =
-{   HAPICOLOR_BLACK, HAPICOLOR_WITHE, HAPICOLOR_RED, 
HAPICOLOR_BRIGHTGREEN, HAPICOLOR_BLUE, HAPICOLOR_YELLOW, HAPICOLOR_PINK,
+{   HAPICOLOR_BLACK, HAPICOLOR_WHITE, HAPICOLOR_RED, 
HAPICOLOR_BRIGHTGREEN, HAPICOLOR_BLUE, HAPICOLOR_YELLOW, HAPICOLOR_PINK,
 HAPICOLOR_TURQUOISE, HAPICOLOR_DARKRED, HAPICOLOR_GREEN, 
HAPICOLOR_DARKBLUE, HAPICOLOR_DARKYELLOW, HAPICOLOR_VIOLET,
 HAPICOLOR_TEAL, HAPICOLOR_GRAY_25_PERCENT, HAPICOLOR_GRAY_50_PERCENT, 
HAPICOLOR_PERIWINCKLE, HAPICOLOR_PLUM,
 HAPICOLOR_IVORY, HAPICOLOR_LIGHTTURQUOISE, HAPICOLOR_DARKPRUPLE, 
HAPICOLOR_CORAL, HAPICOLOR_OCEANBLUE, HAPICOLOR_ICEBLUE,
diff --git a/vbahelper/source/vbahelper/vbacolorformat.hxx 
b/vbahelper/source/vbahelper/vbacolorformat.hxx
index d1573a0f0b5d..746c87c9fadc 100644
--- a/vbahelper/source/vbahelper/vbacolorformat.hxx
+++ b/vbahelper/source/vbahelper/vbacolorformat.hxx
@@ -40,7 +40,7 @@ public:
 struct MsoColorIndices
 {
 const static sal_Int32 HAPICOLOR_BLACK = 0;
-const static sal_Int32 HAPICOLOR_WITHE = 16777215;
+const static sal_Int32 HAPICOLOR_WHITE = 16777215;
 const static sal_Int32 HAPICOLOR_RED = 16711680;
 const static sal_Int32 HAPICOLOR_BRIGHTGREEN = 65280;
 const static sal_Int32 HAPICOLOR_BLUE = 255;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-22 Thread Andrea Gelmini (via logerrit)
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b47f733178335779283152f9a24381644cf9c5a6
Author: Andrea Gelmini 
AuthorDate: Thu Aug 22 22:23:15 2019 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 23 07:24:19 2019 +0200

Fix typo

Change-Id: I94efc4ce7e197fb8dc68840939ed75393983be1c
Reviewed-on: https://gerrit.libreoffice.org/77980
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 87c82e472d7c..94c3419f6e2a 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -472,7 +472,7 @@ void VbaApplicationBase::Quit()
 {
 // This is the case of a call from an (OLE) Automation client.
 
-// When an Automation client itself asks the proces to quit, it should 
obey it.
+// When an Automation client itself asks the process to quit, it 
should obey it.
 AsyncQuitHandler::instance().SetForceQuit();
 
 // TODO: Probably we should just close any document windows open by 
the "application"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-14 Thread Tor Lillqvist (via logerrit)
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |   14 --
 vbahelper/source/vbahelper/vbadocumentsbase.cxx   |   20 ++--
 2 files changed, 30 insertions(+), 4 deletions(-)

New commits:
commit 935a5f456755ce132a42fee2792b195cfc5d1fb4
Author: Tor Lillqvist 
AuthorDate: Wed Aug 14 15:46:16 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Aug 15 00:08:37 2019 +0200

Try harder to avoid exceptions screwing stuff up for OLE clients

Change-Id: I5e9ae8669c4f5c561a09f5f21f11a675a40e5929
Reviewed-on: https://gerrit.libreoffice.org/77463
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 90c7e83badc6..82bcf256ace5 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -225,8 +225,18 @@ sal_Bool SAL_CALL VbaApplicationBase::getInteractive()
 uno::Reference< frame::XModel > xModel = getCurrentDocument();
 if (!xModel.is())
 return true;
-uno::Reference< frame::XFrame > xFrame( 
xModel->getCurrentController()->getFrame(), uno::UNO_SET_THROW );
-uno::Reference< awt::XWindow2 > xWindow( xFrame->getContainerWindow(), 
uno::UNO_QUERY_THROW );
+
+uno::Reference< frame::XController > xController( 
xModel->getCurrentController() );
+if (!xController.is())
+return true;
+
+uno::Reference< frame::XFrame > xFrame( xController->getFrame() );
+if (!xFrame.is())
+return true;
+
+uno::Reference< awt::XWindow2 > xWindow( xFrame->getContainerWindow(), 
uno::UNO_QUERY );
+if (!xWindow.is())
+return true;
 
 return xWindow->isEnabled();
 }
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx 
b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index fc20c882f092..1ba2bb1a0b0f 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -222,7 +222,15 @@ uno::Any VbaDocumentsBase::createDocument()
 // #163808# determine state of Application.ScreenUpdating and 
Application.Interactive symbols (before new document is opened)
 uno::Reference< XApplicationBase > xApplication( Application(), 
uno::UNO_QUERY );
 bool bScreenUpdating = !xApplication.is() || 
xApplication->getScreenUpdating();
-bool bInteractive = !xApplication.is() || xApplication->getInteractive();
+bool bInteractive = true;
+
+try
+{
+bInteractive = !xApplication.is() || xApplication->getInteractive();
+}
+catch( const uno::Exception& )
+{
+}
 
 uno::Reference< frame::XDesktop2 > xLoader = 
frame::Desktop::create(mxContext);
 OUString sURL;
@@ -255,7 +263,15 @@ uno::Any VbaDocumentsBase::openDocument( const OUString& 
rFileName, const uno::A
 // #163808# determine state of Application.ScreenUpdating and 
Application.Interactive symbols (before new document is opened)
 uno::Reference< XApplicationBase > xApplication( Application(), 
uno::UNO_QUERY );
 bool bScreenUpdating = !xApplication.is() || 
xApplication->getScreenUpdating();
-bool bInteractive = !xApplication.is() || xApplication->getInteractive();
+bool bInteractive = true;
+
+try
+{
+bInteractive = !xApplication.is() || xApplication->getInteractive();
+}
+catch( const uno::Exception& )
+{
+}
 
 // we need to detect if this is a URL, if not then assume it's a file path
 OUString aURL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-20 Thread Arkadiy Illarionov (via logerrit)
 vbahelper/source/msforms/vbacombobox.cxx   |8 +-
 vbahelper/source/msforms/vbalistbox.cxx|   31 ++
 vbahelper/source/msforms/vbalistcontrolhelper.cxx  |   27 ++--
 vbahelper/source/msforms/vbauserform.cxx   |6 -
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |   16 ++---
 vbahelper/source/vbahelper/vbacommandbars.cxx  |   13 
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |3 
 vbahelper/source/vbahelper/vbaglobalbase.cxx   |   20 ++
 vbahelper/source/vbahelper/vbahelper.cxx   |   64 ++---
 vbahelper/source/vbahelper/vbashapes.cxx   |9 +-
 10 files changed, 64 insertions(+), 133 deletions(-)

New commits:
commit 71a7e17dd7a6425a3df3c5dca25a3dac24ef6fa7
Author: Arkadiy Illarionov 
AuthorDate: Tue Jun 18 23:43:16 2019 +0300
Commit: Noel Grandin 
CommitDate: Thu Jun 20 09:44:52 2019 +0200

Simplify Sequence iterations in vbahelper

Use range-based loops or replace with comphelper or STL functions

Change-Id: I7613057ba7063e04ca39a654f8a15c0354694783
Reviewed-on: https://gerrit.libreoffice.org/74309
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index 851cee0a4098..3f4468d7d07a 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "vbanewfont.hxx"
 #include 
 #include 
@@ -96,15 +97,14 @@ ScVbaComboBox::getListIndex()
 if ( sItems.hasElements() )
 {
 OUString sText = getText();
-sal_Int32 nLen = sItems.getLength();
-for ( sal_Int32 index = 0; !sText.isEmpty() && index < nLen; ++index )
+if (!sText.isEmpty())
 {
-if ( sItems[ index ] == sText )
+sal_Int32 index = comphelper::findValue(sItems, sText);
+if (index != -1)
 {
 SAL_INFO("vbahelper", "getListIndex returning " << index );
 return uno::makeAny( index );
 }
-
 }
 }
 SAL_INFO("vbahelper", "getListIndex returning -1" );
diff --git a/vbahelper/source/msforms/vbalistbox.cxx 
b/vbahelper/source/msforms/vbalistbox.cxx
index 13c878440193..cb35e7b58b40 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -20,6 +20,7 @@
 #include "vbalistbox.hxx"
 #include "vbanewfont.hxx"
 #include 
+#include 
 #include 
 
 using namespace com::sun::star;
@@ -77,17 +78,7 @@ ScVbaListBox::setValue( const uno::Any& _value )
 OUString sValue = getAnyAsString( _value );
 uno::Sequence< OUString > sList;
 m_xProps->getPropertyValue( "StringItemList" ) >>= sList;
-sal_Int16 nLength = static_cast( sList.getLength() );
-sal_Int16 nValue = -1;
-sal_Int16 i = 0;
-for( i = 0; i < nLength; i++ )
-{
-if( sList[i] == sValue )
-{
-nValue = i;
-break;
-}
-}
+sal_Int16 nValue = static_cast(comphelper::findValue(sList, 
sValue));
 if( nValue == -1 )
 throw uno::RuntimeException( "Attribute use invalid." );
 
@@ -164,7 +155,7 @@ void SAL_CALL
 ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex )
 {
 mpListHelper->AddItem( pvargItem, pvargIndex );
-}
+}
 
 void SAL_CALL
 ScVbaListBox::removeItem( const uno::Any& index )
@@ -196,9 +187,7 @@ ScVbaListBox::setValueEvent( const uno::Any& value )
 {
 if( nList[i] == nIndex )
 {
-if( bValue )
-return;
-else
+if( !bValue )
 {
 for( ; i < nLength - 1; i++ )
 {
@@ -208,8 +197,8 @@ ScVbaListBox::setValueEvent( const uno::Any& value )
 //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList 
) );
 fireClickEvent();
 m_xProps->setPropertyValue( "SelectedItems", uno::makeAny( 
nList ) );
-return;
 }
+return;
 }
 }
 if( bValue )
@@ -239,16 +228,10 @@ ScVbaListBox::getValueEvent()
 {
 uno::Sequence< sal_Int16 > nList;
 m_xProps->getPropertyValue( "SelectedItems" ) >>= nList;
-sal_Int32 nLength = nList.getLength();
 sal_Int32 nIndex = m_nIndex;
+bool bRet = std::find(nList.begin(), nList.end(), nIndex) != nList.end();
 
-for( sal_Int32 i = 0; i < nLength; i++ )
-{
-if( nList[i] == nIndex )
-return uno::makeAny( true );
-}
-
-return uno::makeAny( false );
+return uno::makeAny( bRet );
 }
 
 void SAL_CALL
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx 
b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
index 9f72bda981c1..dfbbb19a3bde 100644
--- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
@@ -21,6 +21,7 

[Libreoffice-commits] core.git: vbahelper/source vcl/source vcl/unx writerfilter/source xmloff/source xmlscript/source xmlsecurity/source

2019-05-02 Thread Arkadiy Illarionov (via logerrit)
 vbahelper/source/msforms/vbacombobox.cxx  |4 +-
 vbahelper/source/msforms/vbacontrol.cxx   |2 -
 vbahelper/source/msforms/vbalistbox.cxx   |4 +-
 vcl/source/filter/FilterConfigCache.cxx   |2 -
 vcl/source/gdi/pdfwriter_impl.cxx |2 -
 vcl/source/gdi/print3.cxx |   16 +-
 vcl/source/graphic/UnoGraphicProvider.cxx |4 +-
 vcl/source/treelist/transfer.cxx  |6 +--
 vcl/source/window/printdlg.cxx|4 +-
 vcl/unx/generic/dtrans/X11_selection.cxx  |6 +--
 vcl/unx/generic/dtrans/X11_service.cxx|2 -
 vcl/unx/gtk/a11y/atktable.cxx |2 -
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx  |6 +--
 vcl/unx/gtk/salprn-gtk.cxx|2 -
 vcl/unx/gtk3/gtk3gtkinst.cxx  |2 -
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx  |4 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 -
 writerfilter/source/dmapper/NumberingManager.cxx  |2 -
 xmloff/source/chart/SchXMLAxisContext.cxx |4 +-
 xmloff/source/chart/SchXMLChartContext.cxx|6 +--
 xmloff/source/chart/SchXMLExport.cxx  |   14 
 xmloff/source/chart/SchXMLImport.cxx  |2 -
 xmloff/source/chart/SchXMLTableContext.cxx|6 +--
 xmloff/source/core/RDFaExportHelper.cxx   |2 -
 xmloff/source/core/xmlexp.cxx |4 +-
 xmloff/source/draw/animationexport.cxx|6 +--
 xmloff/source/draw/shapeexport.cxx|4 +-
 xmloff/source/draw/ximpshap.cxx   |4 +-
 xmloff/source/forms/elementexport.cxx |4 +-
 xmloff/source/meta/xmlmetae.cxx   |2 -
 xmloff/source/style/XMLFontStylesContext.cxx  |4 +-
 xmloff/source/style/tabsthdl.cxx  |2 -
 xmloff/source/style/xmlimppr.cxx  |2 -
 xmloff/source/text/XMLRedlineExport.cxx   |2 -
 xmloff/source/text/XMLSectionExport.cxx   |2 -
 xmloff/source/text/txtflde.cxx|2 -
 xmloff/source/transform/Oasis2OOo.cxx |2 -
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx|   10 +++---
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx   |2 -
 xmlsecurity/source/component/documentdigitalsignatures.cxx|2 -
 xmlsecurity/source/dialogs/certificateviewer.cxx  |2 -
 xmlsecurity/source/helper/documentsignaturemanager.cxx|2 -
 xmlsecurity/source/xmlsec/biginteger.cxx  |2 -
 xmlsecurity/source/xmlsec/nss/ciphercontext.cxx   |6 +--
 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx  |4 +-
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |2 -
 46 files changed, 89 insertions(+), 89 deletions(-)

New commits:
commit 855f52ead7fa361b6a73105d1f0086559a8ed5b6
Author: Arkadiy Illarionov 
AuthorDate: Wed May 1 00:53:03 2019 +0300
Commit: Noel Grandin 
CommitDate: Thu May 2 09:53:48 2019 +0200

Use hasElements to check Sequence emptiness in [v-x]*

Similar to clang-tidy readability-container-size-empty

Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c
Reviewed-on: https://gerrit.libreoffice.org/71603
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index 78ceafb5ea88..851cee0a4098 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -93,7 +93,7 @@ ScVbaComboBox::getListIndex()
 m_xProps->getPropertyValue( "StringItemList" ) >>= sItems;
 // should really return the item that has focus regardless of
 // it been selected
-if ( sItems.getLength() > 0 )
+if ( sItems.hasElements() )
 {
 OUString sText = getText();
 sal_Int32 nLen = sItems.getLength();
@@ -106,7 +106,7 @@ ScVbaComboBox::getListIndex()
 }
 
 }
- }
+}
 SAL_INFO("vbahelper", "getListIndex returning -1" );
 return uno::makeAny( sal_Int32( -1 ) );
 }
diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 99c6b41fea33..d33916f8d5af 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -538,7 +538,7 @@ void SAL_CALL ScVbaControl::fireEvent( const 

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

2019-04-23 Thread Andrea Gelmini (via logerrit)
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1589e54e807a31d9ee21dae52f25282b3a1ff7d6
Author: Andrea Gelmini 
AuthorDate: Tue Apr 16 13:54:48 2019 +
Commit: Julien Nabet 
CommitDate: Tue Apr 23 09:20:15 2019 +0200

Fix typo

Change-Id: I9fa72190a843d1f229deec8dad7f8ef0d5dd5570
Reviewed-on: https://gerrit.libreoffice.org/71081
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 0ffd29eb2e1c..612c32c810ea 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -180,7 +180,7 @@ bool VbaCommandBarHelper::hasToolbar( const OUString& 
sResourceUrl, const OUStri
 // return the resource url if found
 OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< 
css::container::XNameAccess >& xNameAccess, const OUString& sName )
 {
-// check if it is an buildin toolbar
+// check if it is a buildin toolbar
 OUString sResourceUrl = 
MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName 
);
 if( !sResourceUrl.isEmpty() )
 return sResourceUrl;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-07 Thread Libreoffice Gerrit user
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 50ffab5ff0b17add475c3199cd889196d4af2ce2
Author: Tor Lillqvist 
AuthorDate: Thu Mar 7 15:49:21 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Mar 7 20:49:48 2019 +0100

tdf#123819: Revert "Use comphelper::getProcessComponentContext()"

Even though in theory it was worse to get an exception and return an
empty Any for CommandBars, in practice there are not resources to
figure out why that change apparently then caused a crash in the
customer application. Let's hope that it doesn't actually need the
CommandBars object for anything essential.

This reverts commit 87b4bd61792b28fe475c71d4484cd219c1e533ae.

Change-Id: Id2ec3a7254c5dd5a36ce2d5e930a457b9abd44f1
Reviewed-on: https://gerrit.libreoffice.org/68881
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 533f96713d18..1406376ed307 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -111,13 +111,12 @@ void VbaCommandBarHelper::Init( )
 throw uno::RuntimeException( "Not implemented" );
 }
 
-css::uno::Reference< css::uno::XComponentContext > 
xContext(comphelper::getProcessComponentContext());
 css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > 
xUICfgMgrSupp(
-css::ui::theModuleUIConfigurationManagerSupplier::get( xContext ) );
+css::ui::theModuleUIConfigurationManagerSupplier::get(mxContext) );
 
 m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), 
uno::UNO_QUERY_THROW );
 
-css::uno::Reference< css::container::XNameAccess > xNameAccess = 
css::ui::theWindowStateConfiguration::get( xContext );
+css::uno::Reference< css::container::XNameAccess > xNameAccess = 
css::ui::theWindowStateConfiguration::get( mxContext );
 
 m_xWindowState.set( xNameAccess->getByName( maModuleId ), 
uno::UNO_QUERY_THROW );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-02 Thread Libreoffice Gerrit user
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 21233e29602e3a003b18bb0710e9be458bc27235
Author: Tor Lillqvist 
AuthorDate: Fri Mar 1 17:43:13 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Sat Mar 2 16:52:46 2019 +0100

Use comphelper::getProcessComponentContext()

The context in the mxContext member does not seem to be usable for
what we need it for here. Using what
comphelper::getProcessComponentContext() returns works better. Let's
hope it has no unintended side-effects.

This likely makes the mxContext member unused, but I did not bother
removing it yet, to keep this commit minimal.

Change-Id: Ic048683b066af7952e2e84b03ea306e7daaba259
Reviewed-on: https://gerrit.libreoffice.org/68592
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 961288463c63..533f96713d18 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -110,12 +111,13 @@ void VbaCommandBarHelper::Init( )
 throw uno::RuntimeException( "Not implemented" );
 }
 
+css::uno::Reference< css::uno::XComponentContext > 
xContext(comphelper::getProcessComponentContext());
 css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > 
xUICfgMgrSupp(
-css::ui::theModuleUIConfigurationManagerSupplier::get(mxContext) );
+css::ui::theModuleUIConfigurationManagerSupplier::get( xContext ) );
 
 m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), 
uno::UNO_QUERY_THROW );
 
-css::uno::Reference< css::container::XNameAccess > xNameAccess = 
css::ui::theWindowStateConfiguration::get( mxContext );
+css::uno::Reference< css::container::XNameAccess > xNameAccess = 
css::ui::theWindowStateConfiguration::get( xContext );
 
 m_xWindowState.set( xNameAccess->getByName( maModuleId ), 
uno::UNO_QUERY_THROW );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-02 Thread Libreoffice Gerrit user
 vbahelper/source/vbahelper/vbacommandbars.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fbee19602e5f530f25b4d2fe01e73bf5946cfe4d
Author: Tor Lillqvist 
AuthorDate: Fri Mar 1 17:50:18 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Sat Mar 2 16:52:26 2019 +0100

Use sal_Int32 for the index as it comes in as a LONG at least from VBScript

Change-Id: If39054148f72211eae3c897675708aab58f425b2
Reviewed-on: https://gerrit.libreoffice.org/68593
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vbahelper/source/vbahelper/vbacommandbars.cxx 
b/vbahelper/source/vbahelper/vbacommandbars.cxx
index f8810e8ed359..b31ce704709d 100644
--- a/vbahelper/source/vbahelper/vbacommandbars.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbars.cxx
@@ -208,7 +208,7 @@ ScVbaCommandBars::Item( const uno::Any& aIndex, const 
uno::Any& /*aIndex2*/ )
 }
 
 // hardcode if "aIndex = 1" that would return "main menu".
-sal_Int16 nIndex = 0;
+sal_Int32 nIndex = 0;
 aIndex >>= nIndex;
 if( nIndex == 1 )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-25 Thread Libreoffice Gerrit user
 vbahelper/source/vbahelper/vbadocumentsbase.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit db03d555e857a9cfc82b8ec19dd56514361849f6
Author: Tor Lillqvist 
AuthorDate: Mon Feb 25 11:04:12 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Feb 25 11:04:42 2019 +0200

I did figure it out

Change-Id: Iabf2dd2daf9d079e7588a1175a2d1e763ccc1c64

diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx 
b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index 78c28c8c5d8b..fc20c882f092 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -285,12 +285,6 @@ uno::Any VbaDocumentsBase::openDocument( const OUString& 
rFileName, const uno::A
 }
 }
 
-// FIXME: Should we add an AsTemplate property with value false
-// here, to be absolutely sure it doesn't (for some mysterious
-// reason) open the document as a template (as happens for a .rtf
-// file at a customer)? Nah, let's see first if I can figure out
-// what the mysterious reason is...
-
 uno::Reference< lang::XComponent > xComponent = 
xDesktop->loadComponentFromURL( aURL,
 "_default" ,
 frame::FrameSearchFlag::CREATE,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-15 Thread Libreoffice Gerrit user
 vbahelper/source/vbahelper/vbadocumentsbase.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 58ce8be9f96f812ac7ac274c1b2ee30a3283b633
Author: Tor Lillqvist 
AuthorDate: Fri Feb 15 11:31:00 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Feb 15 11:36:07 2019 +0200

Add a FIXME note

Change-Id: Iedda7ca9cff1bda763845e665e0e21656b253793

diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx 
b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index fc20c882f092..78c28c8c5d8b 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -285,6 +285,12 @@ uno::Any VbaDocumentsBase::openDocument( const OUString& 
rFileName, const uno::A
 }
 }
 
+// FIXME: Should we add an AsTemplate property with value false
+// here, to be absolutely sure it doesn't (for some mysterious
+// reason) open the document as a template (as happens for a .rtf
+// file at a customer)? Nah, let's see first if I can figure out
+// what the mysterious reason is...
+
 uno::Reference< lang::XComponent > xComponent = 
xDesktop->loadComponentFromURL( aURL,
 "_default" ,
 frame::FrameSearchFlag::CREATE,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2018-11-22 Thread Libreoffice Gerrit user
 vbahelper/source/msforms/vbabutton.cxx   |8 ++
 vbahelper/source/msforms/vbacheckbox.cxx |8 ++
 vbahelper/source/msforms/vbacombobox.cxx |8 ++
 vbahelper/source/msforms/vbacontrol.cxx  |8 ++
 vbahelper/source/msforms/vbaimage.cxx|8 ++
 vbahelper/source/msforms/vbalabel.cxx|8 ++
 vbahelper/source/msforms/vbalistbox.cxx  |8 ++
 vbahelper/source/msforms/vbamultipage.cxx|8 ++
 vbahelper/source/msforms/vbapages.cxx|8 ++
 vbahelper/source/msforms/vbaprogressbar.cxx  |8 ++
 vbahelper/source/msforms/vbaradiobutton.cxx  |8 ++
 vbahelper/source/msforms/vbascrollbar.cxx|8 ++
 vbahelper/source/msforms/vbaspinbutton.cxx   |8 ++
 vbahelper/source/msforms/vbasystemaxcontrol.cxx  |8 ++
 vbahelper/source/msforms/vbatextbox.cxx  |8 ++
 vbahelper/source/msforms/vbatogglebutton.cxx |8 ++
 vbahelper/source/msforms/vbauserform.cxx |8 ++
 vbahelper/source/vbahelper/vbaapplicationbase.cxx|8 ++
 vbahelper/source/vbahelper/vbacolorformat.cxx|8 ++
 vbahelper/source/vbahelper/vbacommandbar.cxx |   16 
 vbahelper/source/vbahelper/vbacommandbarcontrol.cxx  |   24 +++
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |   16 
 vbahelper/source/vbahelper/vbacommandbars.cxx|8 ++
 vbahelper/source/vbahelper/vbadocumentbase.cxx   |8 ++
 vbahelper/source/vbahelper/vbafillformat.cxx |8 ++
 vbahelper/source/vbahelper/vbahelper.cxx |7 -
 vbahelper/source/vbahelper/vbalineformat.cxx |8 ++
 vbahelper/source/vbahelper/vbapictureformat.cxx  |8 ++
 vbahelper/source/vbahelper/vbashape.cxx  |8 ++
 vbahelper/source/vbahelper/vbashaperange.cxx |8 ++
 vbahelper/source/vbahelper/vbashapes.cxx |8 ++
 vbahelper/source/vbahelper/vbatextframe.cxx  |8 ++
 vbahelper/source/vbahelper/vbawindowbase.cxx |8 ++
 33 files changed, 109 insertions(+), 186 deletions(-)

New commits:
commit 28d82c33131f5f1a300c632acc06e027b04a5a4d
Author: Noel Grandin 
AuthorDate: Thu Nov 22 13:12:52 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 22 14:27:18 2018 +0100

improve function-local statics in vbahelper

Change-Id: Id54660390baa337d8bd54a19924e138c2ccb0bc7
Reviewed-on: https://gerrit.libreoffice.org/63790
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbabutton.cxx 
b/vbahelper/source/msforms/vbabutton.cxx
index 0951731d2c64..7c7e98143432 100644
--- a/vbahelper/source/msforms/vbabutton.cxx
+++ b/vbahelper/source/msforms/vbabutton.cxx
@@ -118,12 +118,10 @@ VbaButton::getServiceImplName()
 uno::Sequence< OUString >
 VbaButton::getServiceNames()
 {
-static uno::Sequence< OUString > aServiceNames;
-if ( aServiceNames.getLength() == 0 )
+static uno::Sequence< OUString > const aServiceNames
 {
-aServiceNames.realloc( 1 );
-aServiceNames[ 0 ] = "ooo.vba.msforms.Button";
-}
+"ooo.vba.msforms.Button"
+};
 return aServiceNames;
 }
 
diff --git a/vbahelper/source/msforms/vbacheckbox.cxx 
b/vbahelper/source/msforms/vbacheckbox.cxx
index 83928d8567c4..719fd3183696 100644
--- a/vbahelper/source/msforms/vbacheckbox.cxx
+++ b/vbahelper/source/msforms/vbacheckbox.cxx
@@ -92,12 +92,10 @@ ScVbaCheckbox::getServiceImplName()
 uno::Sequence< OUString >
 ScVbaCheckbox::getServiceNames()
 {
-static uno::Sequence< OUString > aServiceNames;
-if ( aServiceNames.getLength() == 0 )
+static uno::Sequence< OUString > const aServiceNames
 {
-aServiceNames.realloc( 1 );
-aServiceNames[ 0 ] = "ooo.vba.msforms.CheckBox";
-}
+"ooo.vba.msforms.CheckBox"
+};
 return aServiceNames;
 }
 
diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index 65e946e0516a..78ceafb5ea88 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -299,12 +299,10 @@ void SAL_CALL ScVbaComboBox::setLinkedCell( const 
OUString& _linkedcell )
 uno::Sequence< OUString >
 ScVbaComboBox::getServiceNames()
 {
-static uno::Sequence< OUString > aServiceNames;
-if ( aServiceNames.getLength() == 0 )
+static uno::Sequence< OUString > const aServiceNames
 {
-aServiceNames.realloc( 1 );
-aServiceNames[ 0 ] = "ooo.vba.msforms.ComboBox";
-}
+"ooo.vba.msforms.ComboBox"
+};
 return aServiceNames;
 }
 
diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 65c2e9838519..8f60a67af807 100644
--- 

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

2018-10-04 Thread Libreoffice Gerrit user
 vbahelper/source/msforms/vbabutton.cxx  |3 -
 vbahelper/source/msforms/vbabutton.hxx  |2 
 vbahelper/source/msforms/vbacheckbox.cxx|3 -
 vbahelper/source/msforms/vbacheckbox.hxx|2 
 vbahelper/source/msforms/vbacombobox.cxx|3 -
 vbahelper/source/msforms/vbacombobox.hxx|2 
 vbahelper/source/msforms/vbacontrol.cxx |   65 
 vbahelper/source/msforms/vbacontrol.hxx |4 -
 vbahelper/source/msforms/vbaframe.cxx   |4 -
 vbahelper/source/msforms/vbaframe.hxx   |2 
 vbahelper/source/msforms/vbaimage.cxx   |3 -
 vbahelper/source/msforms/vbaimage.hxx   |2 
 vbahelper/source/msforms/vbalabel.cxx   |3 -
 vbahelper/source/msforms/vbalabel.hxx   |2 
 vbahelper/source/msforms/vbalistbox.cxx |4 -
 vbahelper/source/msforms/vbalistbox.hxx |2 
 vbahelper/source/msforms/vbamultipage.cxx   |4 -
 vbahelper/source/msforms/vbamultipage.hxx   |2 
 vbahelper/source/msforms/vbaprogressbar.cxx |3 -
 vbahelper/source/msforms/vbaprogressbar.hxx |2 
 vbahelper/source/msforms/vbaradiobutton.cxx |3 -
 vbahelper/source/msforms/vbaradiobutton.hxx |2 
 vbahelper/source/msforms/vbascrollbar.cxx   |3 -
 vbahelper/source/msforms/vbascrollbar.hxx   |2 
 vbahelper/source/msforms/vbaspinbutton.cxx  |3 -
 vbahelper/source/msforms/vbaspinbutton.hxx  |2 
 vbahelper/source/msforms/vbasystemaxcontrol.cxx |4 -
 vbahelper/source/msforms/vbasystemaxcontrol.hxx |2 
 vbahelper/source/msforms/vbatextbox.cxx |3 -
 vbahelper/source/msforms/vbatextbox.hxx |2 
 vbahelper/source/msforms/vbatogglebutton.cxx|3 -
 vbahelper/source/msforms/vbatogglebutton.hxx|2 
 vbahelper/source/msforms/vbauserform.cxx|7 +-
 33 files changed, 85 insertions(+), 70 deletions(-)

New commits:
commit 6ed7696c35599068a29af355da1173416a4e7196
Author: Noel Grandin 
AuthorDate: Wed Oct 3 16:51:07 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 4 13:07:16 2018 +0200

pass AbstractGeometryAttributes around by std::unique_ptr

Change-Id: I6e06c89b5e4b77c8fc5e3e1a6bf7d76d8ebd7810
Reviewed-on: https://gerrit.libreoffice.org/61349
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbabutton.cxx 
b/vbahelper/source/msforms/vbabutton.cxx
index 5070bade10b2..0951731d2c64 100644
--- a/vbahelper/source/msforms/vbabutton.cxx
+++ b/vbahelper/source/msforms/vbabutton.cxx
@@ -23,7 +23,8 @@
 using namespace com::sun::star;
 using namespace ooo::vba;
 
-VbaButton::VbaButton( const uno::Reference< XHelperInterface >& xParent, const 
uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< 
uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, 
AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, 
xControl, xModel, pGeomHelper )
+VbaButton::VbaButton( const uno::Reference< XHelperInterface >& xParent, const 
uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< 
uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, 
std::unique_ptr pGeomHelper )
+: ButtonImpl_BASE( xParent, xContext, xControl, xModel, 
std::move(pGeomHelper) )
 {
 }
 
diff --git a/vbahelper/source/msforms/vbabutton.hxx 
b/vbahelper/source/msforms/vbabutton.hxx
index af6ab6a10d65..ad2aed40d0fe 100644
--- a/vbahelper/source/msforms/vbabutton.hxx
+++ b/vbahelper/source/msforms/vbabutton.hxx
@@ -29,7 +29,7 @@ typedef cppu::ImplInheritanceHelper< ScVbaControl, 
ov::msforms::XCommandButton >
 class VbaButton : public ButtonImpl_BASE
 {
 public:
-VbaButton( const css::uno::Reference< ov::XHelperInterface >& xParent, 
const css::uno::Reference< css::uno::XComponentContext >& xContext, const 
css::uno::Reference< css::uno::XInterface >& xControl, const 
css::uno::Reference< css::frame::XModel >& xModel, 
ov::AbstractGeometryAttributes* pGeomHelper  );
+VbaButton( const css::uno::Reference< ov::XHelperInterface >& xParent, 
const css::uno::Reference< css::uno::XComponentContext >& xContext, const 
css::uno::Reference< css::uno::XInterface >& xControl, const 
css::uno::Reference< css::frame::XModel >& xModel, 
std::unique_ptr pGeomHelper  );
// Attributes
 virtual OUString SAL_CALL getCaption() override;
 virtual void SAL_CALL setCaption( const OUString& _caption ) override;
diff --git a/vbahelper/source/msforms/vbacheckbox.cxx 
b/vbahelper/source/msforms/vbacheckbox.cxx
index 41b8b941c5ce..83928d8567c4 100644
--- a/vbahelper/source/msforms/vbacheckbox.cxx
+++ b/vbahelper/source/msforms/vbacheckbox.cxx
@@ -24,7 +24,8 @@
 using namespace com::sun::star;
 using namespace ooo::vba;
 
-ScVbaCheckbox::ScVbaCheckbox( const uno::Reference< ov::XHelperInterface >& 
xParent, const uno::Reference< uno::XComponentContext 

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

2018-09-26 Thread Libreoffice Gerrit user
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |   18 ++
 1 file changed, 2 insertions(+), 16 deletions(-)

New commits:
commit fd84276cf31182c80fc07c88537f9524c4d80e8c
Author: Noel Grandin 
AuthorDate: Tue Sep 25 15:25:50 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 26 08:59:39 2018 +0200

loplugin:useuniqueptr in VbaApplicationBase_Impl

Change-Id: I4ce3cba4a6f5cfec677550a4263bb3e4cc795c49
Reviewed-on: https://gerrit.libreoffice.org/60974
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index c10ce37aef61..a441653551e4 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -145,7 +145,7 @@ struct VbaTimerInfoHash
 }
 };
 
-typedef std::unordered_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash > 
VbaTimerHashMap;
+typedef std::unordered_map< VbaTimerInfo, std::unique_ptr, 
VbaTimerInfoHash > VbaTimerHashMap;
 
 struct VbaApplicationBase_Impl final
 {
@@ -154,18 +154,6 @@ struct VbaApplicationBase_Impl final
 OUString msCaption;
 
 VbaApplicationBase_Impl() : mbVisible( true ) {}
-
-~VbaApplicationBase_Impl()
-{
-// remove the remaining timers
-for ( VbaTimerHashMap::iterator aIter = m_aTimerHash.begin();
-  aIter != m_aTimerHash.end();
-  ++aIter )
-{
-delete aIter->second;
-aIter->second = nullptr;
-}
-}
 };
 
 VbaApplicationBase::VbaApplicationBase( const uno::Reference< 
uno::XComponentContext >& xContext )
@@ -395,15 +383,13 @@ void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& 
aEarliestTime, const O
 VbaTimerHashMap::iterator aIter = m_pImpl->m_aTimerHash.find( aTimerIndex 
);
 if ( aIter != m_pImpl->m_aTimerHash.end() )
 {
-delete aIter->second;
-aIter->second = nullptr;
 m_pImpl->m_aTimerHash.erase( aIter );
 }
 
 if ( bSetTimer )
 {
 VbaTimer* pTimer = new VbaTimer;
-m_pImpl->m_aTimerHash[ aTimerIndex ] = pTimer;
+m_pImpl->m_aTimerHash[ aTimerIndex ].reset(pTimer);
 pTimer->Start( this, aFunction, nEarliestTime, nLatestTime );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-05 Thread Tor Lillqvist
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 89071bdb1d7007bed08e78953e06bafde87cfda4
Author: Tor Lillqvist 
Date:   Tue Jun 5 13:49:42 2018 +0300

Also in getInteractive() we want to return true, not false, if no model

Change-Id: I6b2d24792a16e934f7386c235b7d0cd78300b2b3
Reviewed-on: https://gerrit.libreoffice.org/55328
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 90accd2b32eb..c1b780c54985 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -239,7 +239,7 @@ sal_Bool SAL_CALL VbaApplicationBase::getInteractive()
 {
 uno::Reference< frame::XModel > xModel = getCurrentDocument();
 if (!xModel.is())
-return false;
+return true;
 uno::Reference< frame::XFrame > xFrame( 
xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
 uno::Reference< awt::XWindow2 > xWindow( xFrame->getContainerWindow(), 
uno::UNO_QUERY_THROW );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-05 Thread Tor Lillqvist
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7ae3c8648af4f38f62a98c0910056d2529bb332d
Author: Tor Lillqvist 
Date:   Tue Jun 5 13:08:42 2018 +0300

We want screen updating when used from Automation with no current document 
yet

Change-Id: Iec831ef4b4bf47a58bc67b3beb924e75cd42434e
Reviewed-on: https://gerrit.libreoffice.org/55327
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index d550731cc89f..90accd2b32eb 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -183,7 +183,7 @@ VbaApplicationBase::getScreenUpdating()
 {
 uno::Reference< frame::XModel > xModel = getCurrentDocument();
 if (!xModel.is())
-return false;
+return true;
 return !xModel->hasControllersLocked();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-30 Thread Tor Lillqvist
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit d7f69b1cb4dbdd39970d56d0c340d7abb92fbdc1
Author: Tor Lillqvist 
Date:   Mon Mar 5 22:00:54 2018 +0200

Add code to VbaApplicationBase::Quit() for the Automation client case

Change-Id: I4354adf5353bdfb0b080b24a5c49e3d22539eb23
Reviewed-on: https://gerrit.libreoffice.org/55051
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 198c71fb6c45..a0268237efe6 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -45,6 +46,8 @@
 #include 
 #include 
 
+#include 
+
 #include "vbacommandbars.hxx"
 
 #include 
@@ -440,6 +443,15 @@ void VbaApplicationBase::Quit()
 pBasic->QuitAndExitApplication();
 }
 }
+else
+{
+// This is the case of a call from an (OLE) Automation client.
+
+// TODO: Probably we should just close any document windows open by 
the "application"
+// (Writer or Calc) the call being handled is for. And only then, if 
no document windows
+// are left open, quit the actual LibreOffice application.
+Application::PostUserEvent( LINK( ::instance(), 
AsyncQuitHandler, OnAsyncQuit ) );
+}
 }
 
 /* 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: vbahelper/source

2018-05-29 Thread Samuel Mehrbrodt
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 535f31419ab61c33212b1dd2693e34968902d3ad
Author: Samuel Mehrbrodt 
Date:   Mon May 28 14:45:31 2018 +0200

Add missing include

Change-Id: I0b3af7ac36631748c0d33afb6d06d19761af9c41
Reviewed-on: https://gerrit.libreoffice.org/54926
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index b2d01cfa633f..5b344dc61225 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -18,6 +18,7 @@
  */
 #include "vbacommandbarhelper.hxx"
 #include 
+#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-25 Thread Tor Lillqvist
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 3ebaf1a9fb28be42358f5460e5ab7322d4f1dee8
Author: Tor Lillqvist 
Date:   Tue Mar 6 10:02:44 2018 +0200

Bin some ASCII graphics

Change-Id: I53ef86a997f4ae1c0ad84bb381327cba3143dd4c

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 2fb92cf5c786..198c71fb6c45 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -54,10 +54,8 @@ using namespace ::ooo::vba;
 
 #define OFFICEVERSION "11.0"
 
-// VbaTimerInfo==
 typedef ::std::pair< OUString, ::std::pair< double, double > > VbaTimerInfo;
 
-// VbaTimer==
 class VbaTimer
 {
 Timer m_aTimer;
@@ -134,7 +132,6 @@ IMPL_LINK_NOARG(VbaTimer, MacroCallHdl, Timer *, void)
 {}
 }
 
-// VbaTimerInfoHash==
 struct VbaTimerInfoHash
 {
 size_t operator()( const VbaTimerInfo& rTimerInfo ) const
@@ -145,10 +142,8 @@ struct VbaTimerInfoHash
 }
 };
 
-// VbaTimerHashMap==
 typedef std::unordered_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash > 
VbaTimerHashMap;
 
-// VbaApplicationBase_Impl==
 struct VbaApplicationBase_Impl final
 {
 VbaTimerHashMap m_aTimerHash;
@@ -169,7 +164,6 @@ struct VbaApplicationBase_Impl final
 }
 };
 
-// VbaApplicationBase==
 VbaApplicationBase::VbaApplicationBase( const uno::Reference< 
uno::XComponentContext >& xContext )
 : ApplicationBase_BASE( uno::Reference< XHelperInterface 
>(), xContext )
 , m_pImpl( new VbaApplicationBase_Impl )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-22 Thread Takeshi Abe
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |9 -
 xmloff/source/text/txtlists.cxx   |8 
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 1091e786b420a964b899e9c0a9c399d07946536c
Author: Takeshi Abe 
Date:   Tue May 22 13:28:15 2018 +0900

vbahelper, xmloff: Ask current datetime only once

Change-Id: I930983fab11d30f0887965fe30b07c5ac6eef8ef
Reviewed-on: https://gerrit.libreoffice.org/54651
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 25e91647694b..2fb92cf5c786 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -78,13 +78,12 @@ public:
 
 static double GetNow()
 {
-Date aDateNow( Date::SYSTEM );
-tools::Time aTimeNow( tools::Time::SYSTEM );
- Date aRefDate( 1,1,1900 );
-long nDiffDays = aDateNow - aRefDate;
+DateTime aNow( DateTime::SYSTEM );
+Date aRefDate( 1,1,1900 );
+long nDiffDays = aNow - aRefDate;
 nDiffDays += 2; // Change VisualBasic: 1.Jan.1900 == 2
 
-long nDiffSeconds = aTimeNow.GetHour() * 3600 + aTimeNow.GetMin() * 60 
+ aTimeNow.GetSec();
+long nDiffSeconds = aNow.GetHour() * 3600 + aNow.GetMin() * 60 + 
aNow.GetSec();
 return static_cast(nDiffDays) + 
static_cast(nDiffSeconds)/double(24*3600);
 }
 
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index ff57fbe0f601..40c85cb63c9c 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -23,8 +23,7 @@
 
 #include 
 
-#include 
-#include 
+#include 
 
 #include 
 #include 
@@ -198,8 +197,9 @@ OUString XMLTextListsHelper::GenerateNewListId() const
 else
 {
 // Value of xml:id in element  has to be a valid ID type 
(#i92478#)
-sal_Int64 n = ::tools::Time( ::tools::Time::SYSTEM ).GetTime();
-n += Date( Date::SYSTEM ).GetDateUnsigned();
+DateTime aDateTime( DateTime::SYSTEM );
+sal_Int64 n = aDateTime.GetTime();
+n += aDateTime.GetDateUnsigned();
 n += comphelper::rng::uniform_int_distribution(0, 
std::numeric_limits::max());
 // Value of xml:id in element  has to be a valid ID type 
(#i92478#)
 sTmpStr += OUString::number( n );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-06 Thread Noel Grandin
 vbahelper/source/msforms/vbacontrol.cxx   |2 +-
 vbahelper/source/vbahelper/vbacolorformat.cxx |2 +-
 vbahelper/source/vbahelper/vbahelper.cxx  |1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b8b7f8a8f8d97088181d287bb75e74facece16c6
Author: Noel Grandin 
Date:   Tue Mar 6 10:46:22 2018 +0200

use more Color in vbahelper

Change-Id: I9d153b184a394ac21d504cb503731f8c5c8ec1de
Reviewed-on: https://gerrit.libreoffice.org/50797
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 0db919760dc6..8ea64d041ee5 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -424,7 +424,7 @@ void SAL_CALL ScVbaControl::setTag( const OUString& aTag )
 
 ::sal_Int32 SAL_CALL ScVbaControl::getForeColor()
 {
-sal_Int32 nForeColor = -1;
+Color nForeColor;
 m_xProps->getPropertyValue( "TextColor" ) >>= nForeColor;
 return OORGBToXLRGB( nForeColor );
 }
diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx 
b/vbahelper/source/vbahelper/vbacolorformat.cxx
index 39ec1c090d93..a052f90c1385 100644
--- a/vbahelper/source/vbahelper/vbacolorformat.cxx
+++ b/vbahelper/source/vbahelper/vbacolorformat.cxx
@@ -77,7 +77,7 @@ ScVbaColorFormat::getRGB()
 default:
 throw uno::RuntimeException( "Second parameter of ColorFormat is 
wrong." );
 }
-nRGB = OORGBToXLRGB( nRGB );
+nRGB = OORGBToXLRGB( Color(nRGB) );
 return nRGB;
 }
 
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx 
b/vbahelper/source/vbahelper/vbahelper.cxx
index b7432c59935c..77174c82fb93 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -304,6 +304,7 @@ OORGBToXLRGB( sal_Int32 nCol )
 sal_Int32 nRGB =  ( nAutoBits | (nBlue << 16) | (nGreen << 8) | nRed );
 return nRGB;
 }
+
 sal_Int32
 XLRGBToOORGB( sal_Int32 nCol )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-06 Thread Tamas Bunth
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 5ee6862ee420f13133ade382d7ef2be319414d40
Author: Tamas Bunth 
Date:   Thu Jul 6 10:46:48 2017 +0200

Create vba library if it did not exist before

Add basicLibraries to the library container in the ensure function.
It is needed in case of an xlsm file, because the VBAProject library
was not added by the filter.

Change-Id: I13f78384b9b1bbff1d9d5b1cd36d5a3b878f63e6
Reviewed-on: https://gerrit.libreoffice.org/39622
Tested-by: Jenkins 
Reviewed-by: Tamás Bunth 

diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx 
b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index 87b6fac6df38..800fa7231f8e 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -295,6 +296,14 @@ void VbaEventsHelperBase::ensureVBALibrary()
 uno::Reference< beans::XPropertySet > xModelProps( mxModel, 
uno::UNO_QUERY_THROW );
 uno::Reference< container::XNameAccess > xBasicLibs( 
xModelProps->getPropertyValue(
 "BasicLibraries" ), uno::UNO_QUERY_THROW );
+
+if(!xBasicLibs->hasByName(maLibraryName) )
+{
+uno::Reference< script::XLibraryContainer > xLibContainer(
+xModelProps->getPropertyValue("BasicLibraries"), 
uno::UNO_QUERY_THROW);
+xLibContainer->createLibrary(maLibraryName);
+}
+
 mxModuleInfos.set( xBasicLibs->getByName( maLibraryName ), 
uno::UNO_QUERY_THROW );
 // listen to changes in the VBA source code
 uno::Reference< util::XChangesNotifier > xChangesNotifier( 
mxModuleInfos, uno::UNO_QUERY_THROW );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-18 Thread Jochen Nitschke
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 1f4d7fc8618828222d7f4447daed4c3361edeea6
Author: Jochen Nitschke 
Date:   Sun Jun 18 11:56:15 2017 +0200

vbahelper: remove unused variable

unused since commit a975624bfeeb08670b90944eda372d6d4755ae34
loplugin:unusedfields in tools..vbahelper

Change-Id: I7643ec97e724c9aedab3509e3c6132fb7d24
Reviewed-on: https://gerrit.libreoffice.org/38921
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx 
b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 1c4261f034f5..0dc0af6406e7 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -164,7 +164,7 @@ ScVbaCommandBarControls::Item( const uno::Any& aIndex, 
const uno::Any& /*aIndex*
 }
 
 uno::Reference< XCommandBarControl > SAL_CALL
-ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const 
uno::Any& Parameter, const uno::Any& Before, const uno::Any& Temporary )
+ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const 
uno::Any& Parameter, const uno::Any& Before, SAL_UNUSED_PARAMETER const 
uno::Any& )
 {
 // Parameter is not supported
 // the following name needs to be individually created;
@@ -172,7 +172,6 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const 
uno::Any& Id, const un
 OUString sCommandUrl( CUSTOM_MENU_STR + sLabel);
 sal_Int32 nType = office::MsoControlType::msoControlButton;
 sal_Int32 nPosition = 0;
-bool bTemporary = true;
 
 if( Type.hasValue() )
 {
@@ -193,9 +192,6 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const 
uno::Any& Id, const un
 else
 nPosition = m_xIndexAccess->getCount();
 
-if( Temporary.hasValue() )
-Temporary >>= bTemporary;
-
 uno::Any aSubMenu;
 if( nType == office::MsoControlType::msoControlPopup )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vbahelper/source vcl/inc vcl/README vcl/source vcl/unx vcl/win

2017-03-25 Thread Andrea Gelmini
 vbahelper/source/vbahelper/vbashapes.cxx |2 +-
 vcl/README   |2 +-
 vcl/inc/opengl/PackedTextureAtlas.hxx|2 +-
 vcl/inc/regband.hxx  |2 +-
 vcl/inc/svdata.hxx   |2 +-
 vcl/inc/unx/fontmanager.hxx  |2 +-
 vcl/inc/win/winlayout.hxx|2 +-
 vcl/source/app/session.cxx   |2 +-
 vcl/source/filter/graphicfilter2.cxx |2 +-
 vcl/source/filter/jpeg/jpegc.cxx |2 +-
 vcl/source/filter/sgfbram.hxx|2 +-
 vcl/source/filter/sgvtext.cxx|2 +-
 vcl/source/filter/wmf/winmtf.cxx |2 +-
 vcl/source/font/fontcache.cxx|2 +-
 vcl/source/gdi/gdimetafiletools.cxx  |2 +-
 vcl/source/gdi/metaact.cxx   |2 +-
 vcl/source/gdi/pdfwriter_impl2.cxx   |2 +-
 vcl/source/gdi/pngread.cxx   |2 +-
 vcl/source/gdi/region.cxx|2 +-
 vcl/source/gdi/sallayout.cxx |2 +-
 vcl/source/outdev/text.cxx   |4 ++--
 vcl/source/uitest/uiobject.cxx   |2 +-
 vcl/source/window/dockmgr.cxx|2 +-
 vcl/unx/generic/app/saldisp.cxx  |2 +-
 vcl/unx/generic/print/common_gfx.cxx |2 +-
 vcl/unx/generic/print/genpspgraphics.cxx |2 +-
 vcl/unx/generic/printer/ppdparser.cxx|2 +-
 vcl/unx/gtk/gtksalmenu.cxx   |2 +-
 vcl/unx/gtk3/gtk3gtkframe.cxx|2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx |2 +-
 vcl/unx/kde4/KDESalGraphics.cxx  |2 +-
 vcl/win/gdi/gdiimpl.hxx  |2 +-
 vcl/win/window/salframe.cxx  |4 ++--
 33 files changed, 35 insertions(+), 35 deletions(-)

New commits:
commit 4c45268adf61a460e6c89f4536fd0ec37775676d
Author: Andrea Gelmini 
Date:   Fri Mar 24 15:31:29 2017 +0100

Fix typos

Change-Id: I623135cd4c76dd6569f4ee521f97dee41de4cb1e
Reviewed-on: https://gerrit.libreoffice.org/35660
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/vbahelper/source/vbahelper/vbashapes.cxx 
b/vbahelper/source/vbahelper/vbashapes.cxx
index dd840240efd8..3e2acc39dfae 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -292,7 +292,7 @@ ScVbaShapes::AddEllipse(sal_Int32 startX, sal_Int32 startY, 
sal_Int32 nLineWidth
 return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
 }
 
-//helpeapi calc
+//helperapi calc
 uno::Any SAL_CALL
 ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, 
sal_Int32 endY )
 {
diff --git a/vcl/README b/vcl/README
index c7c1f9e079ad..2bf842087541 100644
--- a/vcl/README
+++ b/vcl/README
@@ -59,7 +59,7 @@ How the platform abstraction works
  API for platform backends
+ It is a factory for:
  SalFrames, SalVirtualDevices, SalPrinters,
- Timers, the SolarMutexe, Drag and other
+ Timers, the SolarMutex, Drag and other
  objects, as well as the primary event loop wrapper.
 
 Note: references to "SV" in the code mean StarView, which was a
diff --git a/vcl/inc/opengl/PackedTextureAtlas.hxx 
b/vcl/inc/opengl/PackedTextureAtlas.hxx
index 4d9015f33572..a7417fca8b8b 100644
--- a/vcl/inc/opengl/PackedTextureAtlas.hxx
+++ b/vcl/inc/opengl/PackedTextureAtlas.hxx
@@ -19,7 +19,7 @@ struct PackedTexture;
  * Pack texutres into one texutre atlas.
  *
  * This is based on algorithm described in [1] and is an
- * addaptation of "texture atlas generator" from [2].
+ * adaptation of "texture atlas generator" from [2].
  *
  * [1]: http://www.blackpawn.com/texts/lightmaps/
  * [2]: https://github.com/lukaszdk/texture-atlas-generator
diff --git a/vcl/inc/regband.hxx b/vcl/inc/regband.hxx
index 7c1785e98365..e81b1e127fc9 100644
--- a/vcl/inc/regband.hxx
+++ b/vcl/inc/regband.hxx
@@ -25,7 +25,7 @@
 class ImplRegionBand
 
 This class handles one y-band of the region. In this band may contain one
-or more seprarations in x-direction. The y-Band do not contain any
+or more separations in x-direction. The y-Band do not contain any
 separation after creation.
 
 The separations are modified with basic clipping functions like Union and
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index d1b8a6c6fe2c..f14ee66eeeba 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -172,7 +172,7 @@ struct ImplSVGDIData
 ImplPrnQueueList*   mpPrinterQueueList = nullptr;   // List of all 
printer queue
 PhysicalFontCollection* mpScreenFontList = nullptr; // Screen-Font-List
 ImplFontCache*  mpScreenFontCache = nullptr;// 
Screen-Font-Cache
-ImplDirectFontSubstitution* mpDirectFontSubst = nullptr; // 
Font-Substitutons defined in Tools->Options->Fonts
+ImplDirectFontSubstitution* mpDirectFontSubst = nullptr; // 

[Libreoffice-commits] core.git: vbahelper/source vcl/inc vcl/opengl vcl/quartz vcl/README.GDIMetaFile vcl/source vcl/unx vcl/win vcl/workben

2017-03-02 Thread Andrea Gelmini
 vbahelper/source/msforms/vbacombobox.cxx |2 +-
 vcl/README.GDIMetaFile   |2 +-
 vcl/inc/listbox.hxx  |2 +-
 vcl/inc/quartz/salgdi.h  |2 +-
 vcl/inc/salgdi.hxx   |2 +-
 vcl/inc/win/salgdi.h |4 ++--
 vcl/opengl/RenderList.cxx|4 ++--
 vcl/quartz/salgdicommon.cxx  |2 +-
 vcl/source/control/scrbar.cxx|2 +-
 vcl/source/filter/sgvmain.hxx|8 
 vcl/source/filter/sgvtext.cxx|2 +-
 vcl/source/font/fontmetric.cxx   |2 +-
 vcl/source/gdi/bitmapex.cxx  |2 +-
 vcl/source/gdi/pdfwriter_impl.cxx|2 +-
 vcl/source/outdev/polyline.cxx   |2 +-
 vcl/source/outdev/textline.cxx   |4 ++--
 vcl/source/outdev/transparent.cxx|2 +-
 vcl/source/window/toolbox.cxx|2 +-
 vcl/unx/gtk/gtksalmenu.cxx   |2 +-
 vcl/win/window/salobj.cxx|2 +-
 vcl/workben/fftester.cxx |2 +-
 21 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 65434e8701ab71c8bff8b0ac722d41b0592483dc
Author: Andrea Gelmini 
Date:   Thu Mar 2 09:38:03 2017 +0100

Fix typos

Change-Id: I72db7ff99cde394bc161dfd835bfb0d9a47a53d1
Reviewed-on: https://gerrit.libreoffice.org/34780
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index ab26e01..6203355 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -54,7 +54,7 @@ ScVbaComboBox::ScVbaComboBox( const uno::Reference< 
XHelperInterface >& xParent,
 // Attributes
 
 
-// Value, [read] e.g. getValue returns the value of ooo Text propery e.g. the 
value in
+// Value, [read] e.g. getValue returns the value of ooo Text property e.g. the 
value in
 // the drop down
 uno::Any SAL_CALL
 ScVbaComboBox::getValue()
diff --git a/vcl/README.GDIMetaFile b/vcl/README.GDIMetaFile
index 80749c8..2c8879d 100644
--- a/vcl/README.GDIMetaFile
+++ b/vcl/README.GDIMetaFile
@@ -3,7 +3,7 @@ GDIMetaFile class
 
 The GDIMetaFile class reads, writes, manipulates and replays metafiles via the 
VCL module.
 
-A typical use case is to intialize a new GDIMetaFile, open the actual stored 
metafile and
+A typical use case is to initialize a new GDIMetaFile, open the actual stored 
metafile and
 read it in via GDIMetaFile::Read( aIStream ). This reads in the metafile into 
the GDIMetafile
 object - it can read in an old-style VCLMTF metafile (back in the days that 
Microsoft didn't
 document the metafile format this was used), as well as EMF+ files - and adds 
them to a list
diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx
index 8003fd7..bc411a5 100644
--- a/vcl/inc/listbox.hxx
+++ b/vcl/inc/listbox.hxx
@@ -276,7 +276,7 @@ public:
 
 voidSetTopEntry( sal_Int32  nTop );
 sal_Int32   GetTopEntry() const { return mnTop; }
-/** ShowProminentEntry will set the entry correspoding to nEntryPos
+/** ShowProminentEntry will set the entry corresponding to nEntryPos
 either at top or in the middle depending on the chosen style*/
 voidShowProminentEntry( sal_Int32  nEntryPos );
 voidSetProminentEntryType( ProminentEntry eType ) { 
meProminentType = eType; }
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 086266d..248d07e 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -348,7 +348,7 @@ public:
 // pFont: describes from which font to create a subset
 // pGlyphIDs: the glyph ids to be extracted
 // pEncoding: the character code corresponding to each glyph
-// pWidths: the advance widths of the correspoding glyphs (in 
PS font units)
+// pWidths: the advance widths of the corresponding glyphs (in 
PS font units)
 // nGlyphs: the number of glyphs
 // rInfo: additional outgoing information
 // implementation note: encoding 0 with glyph id 0 should be added 
implicitly
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index d71098a..a2b67c0 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -156,7 +156,7 @@ public:
 // pFont: describes from which font to create a subset
 // pGlyphIDs: the glyph ids to be extracted
 // pEncoding: the character code corresponding to each glyph
-// pWidths: the advance widths of the correspoding glyphs (in 
PS font units)
+// pWidths: the advance widths of the corresponding glyphs (in 
PS font units)
 // nGlyphs: the number of glyphs
 // rInfo: additional outgoing 

[Libreoffice-commits] core.git: vbahelper/source vcl/source vcl/unx writerfilter/source

2016-10-31 Thread Noel Grandin
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |3 +--
 vbahelper/source/vbahelper/vbadocumentsbase.cxx|7 ++-
 vbahelper/source/vbahelper/vbahelper.cxx   |6 ++
 vcl/source/font/PhysicalFontCollection.cxx |4 +---
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx   |7 ++-
 vcl/unx/gtk/gtksalmenu.cxx |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |   12 
 writerfilter/source/dmapper/FormControlHelper.cxx  |5 +
 writerfilter/source/dmapper/OLEHandler.cxx |3 +--
 9 files changed, 15 insertions(+), 34 deletions(-)

New commits:
commit 04bfdc0a82c306dbe16e7d79e78f2b1c8fd05475
Author: Noel Grandin 
Date:   Mon Oct 31 10:28:18 2016 +0200

loplugin:oncevar in vbahelper..writerfilter

Change-Id: Ifd7e91753d9652d6b1c535cde3cddf74757a2483
Reviewed-on: https://gerrit.libreoffice.org/30430
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index fe65272..8bd5fb0 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -200,8 +200,7 @@ OUString VbaCommandBarHelper::findToolbarByName( const 
css::uno::Reference< css:
 }
 
 // the customize toolbars creating during importing, should found there.
-static const char sToolbarPrefix[] = "private:resource/toolbar/custom_";
-sResourceUrl = sToolbarPrefix + sName;
+sResourceUrl = "private:resource/toolbar/custom_" + sName;
 if( hasToolbar( sResourceUrl, sName ) )
 return sResourceUrl;
 
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx 
b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index 230a7f0..2816992 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -55,9 +55,6 @@
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 
-static const char aSpreadsheetDocument[] = 
"com.sun.star.sheet.SpreadsheetDocument";
-static const char aTextDocument[] = "com.sun.star.text.TextDocument";
-
 typedef  std::unordered_map< OUString,
  sal_Int32, OUStringHash > NameIndexHash;
 
@@ -131,8 +128,8 @@ public:
 {
 uno::Reference< lang::XServiceInfo > xServiceInfo( 
xEnum->nextElement(), uno::UNO_QUERY );
 if ( xServiceInfo.is()
-&& (  ( xServiceInfo->supportsService( aSpreadsheetDocument ) 
&& meDocType == VbaDocumentsBase::EXCEL_DOCUMENT )
-|| ( xServiceInfo->supportsService( aTextDocument ) && 
meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) )
+&& (  ( xServiceInfo->supportsService( 
"com.sun.star.sheet.SpreadsheetDocument" ) && meDocType == 
VbaDocumentsBase::EXCEL_DOCUMENT )
+|| ( xServiceInfo->supportsService( 
"com.sun.star.text.TextDocument" ) && meDocType == 
VbaDocumentsBase::WORD_DOCUMENT ) ) )
 {
 uno::Reference< frame::XModel > xModel( xServiceInfo, 
uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given
 m_documents.push_back( xModel );
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx 
b/vbahelper/source/vbahelper/vbahelper.cxx
index 76b0e7e..e19c128 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -259,11 +259,10 @@ getThisWordDoc( const uno::Reference< 
uno::XComponentContext >& xContext ) throw
  uno::Reference< frame::XModel >
 getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) 
throw (uno::RuntimeException)
 {
-static const char sThisExcelDoc[] = "ThisExcelDoc";
 uno::Reference< frame::XModel > xModel;
 try
 {
-xModel = getCurrentDoc( sThisExcelDoc );
+xModel = getCurrentDoc( "ThisExcelDoc" );
 }
 catch (const uno::Exception&)
 {
@@ -275,11 +274,10 @@ getCurrentExcelDoc( const uno::Reference< 
uno::XComponentContext >& xContext ) t
  uno::Reference< frame::XModel >
 getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) 
throw (uno::RuntimeException)
 {
-static const char sThisWordDoc[] = "ThisWordDoc";
 uno::Reference< frame::XModel > xModel;
 try
 {
-xModel = getCurrentDoc( sThisWordDoc );
+xModel = getCurrentDoc( "ThisWordDoc" );
 }
 catch (const uno::Exception&)
 {
diff --git a/vcl/source/font/PhysicalFontCollection.cxx 
b/vcl/source/font/PhysicalFontCollection.cxx
index 9bef807..0f744971 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -1138,9 +1138,7 @@ PhysicalFontFamily* 
PhysicalFontCollection::FindFontFamily( FontSelectPattern& r
 a korean bitmap font that is not suitable here. Use the 

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

2016-02-26 Thread Noel Grandin
 vbahelper/source/vbahelper/vbacommandbar.cxx |2 +-
 vbahelper/source/vbahelper/vbacommandbarcontrol.cxx  |4 ++--
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |2 +-
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx   |6 +-
 vbahelper/source/vbahelper/vbacommandbarhelper.hxx   |2 +-
 5 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 692f14208001e646f46c9cd7f85fc93aba4b3982
Author: Noel Grandin 
Date:   Fri Feb 26 10:58:41 2016 +0200

loplugin:unuseddefaultparam, ApplyChange->ApplyTempChange

to make it clear what it's doing, now that I have dropped the param

Change-Id: I9fb8bb0f218aa1b01d9ba357e75af35f067625ed

diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx 
b/vbahelper/source/vbahelper/vbacommandbar.cxx
index 8f4a32b4..6739f36 100644
--- a/vbahelper/source/vbahelper/vbacommandbar.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbar.cxx
@@ -76,7 +76,7 @@ ScVbaCommandBar::setName( const OUString& _name ) throw 
(uno::RuntimeException,
 uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, 
uno::UNO_QUERY_THROW );
 xPropertySet->setPropertyValue( "UIName" , uno::makeAny( _name ) );
 
-pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 }
 sal_Bool SAL_CALL
 ScVbaCommandBar::getVisible() throw (uno::RuntimeException, std::exception)
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx 
b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index 78fd8e7..eb798ac 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -32,7 +32,7 @@ void ScVbaCommandBarControl::ApplyChange() throw ( 
uno::RuntimeException )
 {
 uno::Reference< container::XIndexContainer > xIndexContainer( 
m_xCurrentSettings, uno::UNO_QUERY_THROW );
 xIndexContainer->replaceByIndex( m_nPosition, uno::makeAny( 
m_aPropertyValues ) );
-pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 }
 
 OUString SAL_CALL
@@ -154,7 +154,7 @@ ScVbaCommandBarControl::Delete(  ) throw 
(script::BasicErrorException, uno::Runt
 uno::Reference< container::XIndexContainer > xIndexContainer( 
m_xCurrentSettings, uno::UNO_QUERY_THROW );
 xIndexContainer->removeByIndex( m_nPosition );
 
-pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 }
 }
 
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx 
b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 63b9cb0..e9986ef 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -222,7 +222,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const 
uno::Any& Id, const un
 uno::Reference< container::XIndexContainer > xIndexContainer( 
m_xIndexAccess, uno::UNO_QUERY_THROW );
 xIndexContainer->insertByIndex( nPosition, uno::makeAny( aProps ) );
 
-pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
+pCBarHelper->ApplyTempChange( m_sResourceUrl, m_xBarSettings );
 
 ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
 if( nType == office::MsoControlType::msoControlPopup )
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index ecfd335..671cb34 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -144,7 +144,7 @@ void VbaCommandBarHelper::removeSettings( const OUString& 
sResourceUrl ) throw (
 // persistChanges();
 }
 
-void VbaCommandBarHelper::ApplyChange( const OUString& sResourceUrl, const 
css::uno::Reference< css::container::XIndexAccess >& xSettings, bool bTemporary 
) throw (css::uno::RuntimeException)
+void VbaCommandBarHelper::ApplyTempChange( const OUString& sResourceUrl, const 
css::uno::Reference< css::container::XIndexAccess >& xSettings ) throw 
(css::uno::RuntimeException)
 {
 if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
 {
@@ -154,10 +154,6 @@ void VbaCommandBarHelper::ApplyChange( const OUString& 
sResourceUrl, const css::
 {
 m_xDocCfgMgr->insertSettings( sResourceUrl, xSettings );
 }
-if( !bTemporary )
-{
-persistChanges();
-}
 }
 
 void VbaCommandBarHelper::persistChanges() throw (css::uno::RuntimeException)
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx 
b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
index b54f001..e6aca6b 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx
@@ -72,7 +72,7 @@ public:
 void persistChanges() throw (css::uno::RuntimeException);
 css::uno::Reference< 

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

2015-11-17 Thread Noel Grandin
 vbahelper/source/msforms/vbabutton.cxx   |2 +-
 vbahelper/source/msforms/vbacheckbox.cxx |2 +-
 vbahelper/source/msforms/vbacontrol.cxx  |6 +++---
 vbahelper/source/msforms/vbacontrol.hxx  |   14 +++---
 vbahelper/source/msforms/vbaframe.cxx|2 +-
 vbahelper/source/msforms/vbalabel.cxx|6 +++---
 vbahelper/source/msforms/vbamultipage.cxx|2 +-
 vbahelper/source/msforms/vbaprogressbar.cxx  |2 +-
 vbahelper/source/msforms/vbaradiobutton.cxx  |2 +-
 vbahelper/source/msforms/vbaradiobutton.hxx  |2 +-
 vbahelper/source/msforms/vbascrollbar.cxx|2 +-
 vbahelper/source/msforms/vbaspinbutton.cxx   |2 +-
 vbahelper/source/msforms/vbasystemaxcontrol.hxx  |   12 ++--
 vbahelper/source/msforms/vbatogglebutton.cxx |2 +-
 vbahelper/source/msforms/vbauserform.hxx |   16 
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |2 +-
 vbahelper/source/vbahelper/vbadocumentsbase.cxx  |4 ++--
 17 files changed, 40 insertions(+), 40 deletions(-)

New commits:
commit 89ac4f6255bc9734d1b34bc2994bf275fa1b011f
Author: Noel Grandin 
Date:   Tue Nov 17 16:03:55 2015 +0200

com::sun::star->css in vbahelper/

Change-Id: I7ab89b01cf6817b365a02e73d4635dfdb5b40440
Reviewed-on: https://gerrit.libreoffice.org/20022
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/msforms/vbabutton.cxx 
b/vbahelper/source/msforms/vbabutton.cxx
index 0738333..a7f1672 100644
--- a/vbahelper/source/msforms/vbabutton.cxx
+++ b/vbahelper/source/msforms/vbabutton.cxx
@@ -37,7 +37,7 @@ VbaButton::getCaption() throw (css::uno::RuntimeException, 
std::exception)
 }
 
 void SAL_CALL
-VbaButton::setCaption( const OUString& _caption ) throw 
(::com::sun::star::uno::RuntimeException, std::exception)
+VbaButton::setCaption( const OUString& _caption ) throw 
(css::uno::RuntimeException, std::exception)
 {
 m_xProps->setPropertyValue( "Label", uno::makeAny( _caption ) );
 }
diff --git a/vbahelper/source/msforms/vbacheckbox.cxx 
b/vbahelper/source/msforms/vbacheckbox.cxx
index bd00682..e00270f 100644
--- a/vbahelper/source/msforms/vbacheckbox.cxx
+++ b/vbahelper/source/msforms/vbacheckbox.cxx
@@ -38,7 +38,7 @@ ScVbaCheckbox::getCaption() throw 
(css::uno::RuntimeException, std::exception)
 }
 
 void SAL_CALL
-ScVbaCheckbox::setCaption( const OUString& _caption ) throw 
(::com::sun::star::uno::RuntimeException, std::exception)
+ScVbaCheckbox::setCaption( const OUString& _caption ) throw 
(css::uno::RuntimeException, std::exception)
 {
 m_xProps->setPropertyValue( "Label", uno::makeAny( _caption ) );
 }
diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 98f935d..a687bff 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -427,7 +427,7 @@ void SAL_CALL ScVbaControl::setTag( const OUString& aTag )
 m_aControlTag = aTag;
 }
 
-::sal_Int32 SAL_CALL ScVbaControl::getForeColor() throw 
(::com::sun::star::uno::RuntimeException)
+::sal_Int32 SAL_CALL ScVbaControl::getForeColor() throw 
(css::uno::RuntimeException)
 {
 sal_Int32 nForeColor = -1;
 m_xProps->getPropertyValue( "TextColor" ) >>= nForeColor;
@@ -491,7 +491,7 @@ static Pointer lcl_msoPointerToLOPointer( long 
msoPointerStyle )
 }
 
 ::sal_Int32 SAL_CALL
-ScVbaControl::getMousePointer() throw 
(::com::sun::star::uno::RuntimeException, std::exception)
+ScVbaControl::getMousePointer() throw (css::uno::RuntimeException, 
std::exception)
 {
 PointerStyle eType = PointerStyle::Arrow; // default ?
 vcl::Window* pWindow = VCLUnoHelper::GetWindow( getWindowPeer() );
@@ -503,7 +503,7 @@ ScVbaControl::getMousePointer() throw 
(::com::sun::star::uno::RuntimeException,
 }
 
 void SAL_CALL
-ScVbaControl::setMousePointer( ::sal_Int32 _mousepointer ) throw 
(::com::sun::star::uno::RuntimeException, std::exception)
+ScVbaControl::setMousePointer( ::sal_Int32 _mousepointer ) throw 
(css::uno::RuntimeException, std::exception)
 {
 vcl::Window* pWindow = VCLUnoHelper::GetWindow( getWindowPeer() );
 if ( pWindow )
diff --git a/vbahelper/source/msforms/vbacontrol.hxx 
b/vbahelper/source/msforms/vbacontrol.hxx
index 800ce39..36051a4 100644
--- a/vbahelper/source/msforms/vbacontrol.hxx
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -37,8 +37,8 @@ typedef InheritedHelperInterfaceWeakImpl< 
ov::msforms::XControl > ControlImpl_BA
 class ScVbaControl : public ControlImpl_BASE
 {
 private:
-com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > 
m_xEventListener;
-com::sun::star::uno::Reference< com::sun::star::awt::XControl > 
m_xEmptyFormControl;
+css::uno::Reference< css::lang::XEventListener > m_xEventListener;
+

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

2014-09-15 Thread Stephan Bergmann
 vbahelper/source/msforms/vbabutton.cxx   |2 +-
 vbahelper/source/msforms/vbacheckbox.cxx |2 +-
 vbahelper/source/msforms/vbacombobox.cxx |2 +-
 vbahelper/source/msforms/vbaframe.cxx|2 +-
 vbahelper/source/msforms/vbalabel.cxx|2 +-
 vbahelper/source/msforms/vbalistbox.cxx  |2 +-
 vbahelper/source/msforms/vbanewfont.cxx  |9 -
 vbahelper/source/msforms/vbanewfont.hxx  |7 +--
 vbahelper/source/msforms/vbaradiobutton.cxx  |2 +-
 vbahelper/source/msforms/vbatextbox.cxx  |2 +-
 vbahelper/source/msforms/vbatogglebutton.cxx |2 +-
 11 files changed, 10 insertions(+), 24 deletions(-)

New commits:
commit 82a72bb848c4fc343a9095953242eca03d943780
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Sep 15 10:04:11 2014 +0200

VbaNewFont apparently does not inherit XHelperInterface

...and thus should simply derive from WeakImplHelper1 instead of
InheritedHelperInterfaceImpl1?

Change-Id: I0cb023a905e93bf9c223676c964f039ac7eee7e0

diff --git a/vbahelper/source/msforms/vbabutton.cxx 
b/vbahelper/source/msforms/vbabutton.cxx
index 5220822..0738333 100644
--- a/vbahelper/source/msforms/vbabutton.cxx
+++ b/vbahelper/source/msforms/vbabutton.cxx
@@ -105,7 +105,7 @@ void SAL_CALL VbaButton::setForeColor( sal_Int32 
/*nForeColor*/ ) throw (uno::Ru
 
 uno::Reference msforms::XNewFont  SAL_CALL VbaButton::getFont() throw 
(uno::RuntimeException, std::exception)
 {
-return new VbaNewFont( this, mxContext, m_xProps );
+return new VbaNewFont( m_xProps );
 }
 
 OUString
diff --git a/vbahelper/source/msforms/vbacheckbox.cxx 
b/vbahelper/source/msforms/vbacheckbox.cxx
index 8d97a75..75c3d21e 100644
--- a/vbahelper/source/msforms/vbacheckbox.cxx
+++ b/vbahelper/source/msforms/vbacheckbox.cxx
@@ -79,7 +79,7 @@ ScVbaCheckbox::setValue( const uno::Any _value ) throw 
(css::uno::RuntimeExcept
 
 uno::Reference msforms::XNewFont  SAL_CALL ScVbaCheckbox::getFont() throw 
(uno::RuntimeException, std::exception)
 {
-return new VbaNewFont( this, mxContext, m_xProps );
+return new VbaNewFont( m_xProps );
 }
 
 OUString
diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index 3f2c0df..dc7189b 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -245,7 +245,7 @@ sal_Int32 SAL_CALL ScVbaComboBox::getTextLength() throw 
(uno::RuntimeException,
 
 uno::Reference msforms::XNewFont  SAL_CALL ScVbaComboBox::getFont() throw 
(uno::RuntimeException, std::exception)
 {
-return new VbaNewFont( this, mxContext, m_xProps );
+return new VbaNewFont( m_xProps );
 }
 
 OUString
diff --git a/vbahelper/source/msforms/vbaframe.cxx 
b/vbahelper/source/msforms/vbaframe.cxx
index 0047fdd..756b82d 100644
--- a/vbahelper/source/msforms/vbaframe.cxx
+++ b/vbahelper/source/msforms/vbaframe.cxx
@@ -75,7 +75,7 @@ void SAL_CALL ScVbaFrame::setBorderStyle( sal_Int32 
/*nBorderStyle*/ ) throw (un
 
 uno::Reference msforms::XNewFont  SAL_CALL ScVbaFrame::getFont() throw 
(uno::RuntimeException, std::exception)
 {
-return new VbaNewFont( this, mxContext, m_xProps );
+return new VbaNewFont( m_xProps );
 }
 
 // XFrame methods
diff --git a/vbahelper/source/msforms/vbalabel.cxx 
b/vbahelper/source/msforms/vbalabel.cxx
index ce943e7..fc62e69 100644
--- a/vbahelper/source/msforms/vbalabel.cxx
+++ b/vbahelper/source/msforms/vbalabel.cxx
@@ -70,7 +70,7 @@ ScVbaLabel::setAccelerator( const OUString /*_accelerator*/ 
) throw (::com::sun
 
 uno::Reference msforms::XNewFont  SAL_CALL ScVbaLabel::getFont() throw 
(uno::RuntimeException, std::exception)
 {
-return new VbaNewFont( this, mxContext, m_xProps );
+return new VbaNewFont( m_xProps );
 }
 
 OUString ScVbaLabel::getServiceImplName()
diff --git a/vbahelper/source/msforms/vbalistbox.cxx 
b/vbahelper/source/msforms/vbalistbox.cxx
index 4916018..38effb8 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -274,7 +274,7 @@ ScVbaListBox::List( const ::uno::Any pvargIndex, const 
uno::Any pvarColumn ) t
 
 uno::Reference msforms::XNewFont  SAL_CALL ScVbaListBox::getFont() throw 
(uno::RuntimeException, std::exception)
 {
-return new VbaNewFont( this, mxContext, m_xProps );
+return new VbaNewFont( m_xProps );
 }
 
 OUString
diff --git a/vbahelper/source/msforms/vbanewfont.cxx 
b/vbahelper/source/msforms/vbanewfont.cxx
index d051c1b..5778845 100644
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -30,10 +30,7 @@ using namespace ::ooo::vba;
 
 
 VbaNewFont::VbaNewFont(
-const uno::Reference XHelperInterface  rxParent,
-const uno::Reference uno::XComponentContext  rxContext,
 const uno::Reference beans::XPropertySet  rxModelProps ) throw 
(uno::RuntimeException) :
-VbaNewFont_BASE( rxParent, rxContext ),
 mxProps( rxModelProps, uno::UNO_SET_THROW )
 

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

2014-07-21 Thread Takeshi Abe
 vbahelper/source/msforms/vbacombobox.cxx|1 -
 vbahelper/source/msforms/vbaimage.cxx   |1 -
 vbahelper/source/msforms/vbamultipage.cxx   |1 -
 vbahelper/source/msforms/vbaprogressbar.cxx |1 -
 vbahelper/source/msforms/vbascrollbar.cxx   |1 -
 vbahelper/source/msforms/vbaspinbutton.cxx  |1 -
 6 files changed, 6 deletions(-)

New commits:
commit f31a9abfd20a4ce625fcd985aff4978c34ae1a90
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Tue Jul 22 00:11:49 2014 +0900

Remove unused #includes

Change-Id: I96775ac9a8624e12974c78c6abb93ddd80eed567

diff --git a/vbahelper/source/msforms/vbacombobox.cxx 
b/vbahelper/source/msforms/vbacombobox.cxx
index 8ac4aff..3f2c0df 100644
--- a/vbahelper/source/msforms/vbacombobox.cxx
+++ b/vbahelper/source/msforms/vbacombobox.cxx
@@ -18,7 +18,6 @@
  */
 
 #include vbacombobox.hxx
-#include vector
 #include filter/msfilter/msvbahelper.hxx
 #include basic/sbstar.hxx
 #include basic/sbmod.hxx
diff --git a/vbahelper/source/msforms/vbaimage.cxx 
b/vbahelper/source/msforms/vbaimage.cxx
index 0a27269..0515a11 100644
--- a/vbahelper/source/msforms/vbaimage.cxx
+++ b/vbahelper/source/msforms/vbaimage.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include vbaimage.hxx
-#include vector
 
 using namespace com::sun::star;
 using namespace ooo::vba;
diff --git a/vbahelper/source/msforms/vbamultipage.cxx 
b/vbahelper/source/msforms/vbamultipage.cxx
index 0bacf37..4fa287e 100644
--- a/vbahelper/source/msforms/vbamultipage.cxx
+++ b/vbahelper/source/msforms/vbamultipage.cxx
@@ -19,7 +19,6 @@
 #include vbamultipage.hxx
 #include ooo/vba/XCollection.hpp
 #include vbapages.hxx
-#include vector
 #include com/sun/star/container/XNameContainer.hpp
 
 using namespace com::sun::star;
diff --git a/vbahelper/source/msforms/vbaprogressbar.cxx 
b/vbahelper/source/msforms/vbaprogressbar.cxx
index 23403d2..8d223af 100644
--- a/vbahelper/source/msforms/vbaprogressbar.cxx
+++ b/vbahelper/source/msforms/vbaprogressbar.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include vbaprogressbar.hxx
-#include vector
 
 using namespace com::sun::star;
 using namespace ooo::vba;
diff --git a/vbahelper/source/msforms/vbascrollbar.cxx 
b/vbahelper/source/msforms/vbascrollbar.cxx
index 6379cef..c9c846f 100644
--- a/vbahelper/source/msforms/vbascrollbar.cxx
+++ b/vbahelper/source/msforms/vbascrollbar.cxx
@@ -18,7 +18,6 @@
  */
 
 #include vbascrollbar.hxx
-#include vector
 
 using namespace com::sun::star;
 using namespace ooo::vba;
diff --git a/vbahelper/source/msforms/vbaspinbutton.cxx 
b/vbahelper/source/msforms/vbaspinbutton.cxx
index 9a61ec1..440b072 100644
--- a/vbahelper/source/msforms/vbaspinbutton.cxx
+++ b/vbahelper/source/msforms/vbaspinbutton.cxx
@@ -18,7 +18,6 @@
  */
 
 #include vbaspinbutton.hxx
-#include vector
 
 using namespace com::sun::star;
 using namespace ooo::vba;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-14 Thread Stephan Bergmann
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit e04c36b4591ffa457f3072ea8d3c0c72211d20c7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Apr 14 14:23:11 2014 +0200

Clean up function declarations

Change-Id: I0602166c8e6485b68e06bbcc9f0064938facd3fa

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index af4febc..88b7052 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -33,6 +33,7 @@
 #include com/sun/star/document/XEmbeddedScripts.hpp
 #include com/sun/star/awt/XWindow2.hpp
 
+#include boost/noncopyable.hpp
 #include boost/unordered_map.hpp
 #include filter/msfilter/msvbahelper.hxx
 #include tools/datetime.hxx
@@ -55,16 +56,12 @@ using namespace ::ooo::vba;
 typedef ::std::pair OUString, ::std::pair double, double   VbaTimerInfo;
 
 // VbaTimer==
-class VbaTimer
+class VbaTimer: private boost::noncopyable
 {
 Timer m_aTimer;
 VbaTimerInfo m_aTimerInfo;
 ::rtl::Reference VbaApplicationBase  m_xBase;
 
-// the following declarations are here to prevent the usage of them
-VbaTimer( const VbaTimer );
-VbaTimer operator=( const VbaTimer );
-
 public:
 VbaTimer()
 {}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-12 Thread Julien Nabet
 vbahelper/source/msforms/vbacontrol.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 091f4f14c596ea0c34d891372a4fc820f92e36ae
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Apr 12 23:24:11 2014 +0200

cppcheck: multiCondition, remove 2 duplicate else if blocks

Change-Id: I538bacd0e52a5e7d5df9847ad4632e02124aeb95

diff --git a/vbahelper/source/msforms/vbacontrol.cxx 
b/vbahelper/source/msforms/vbacontrol.cxx
index 7e39227..fdcfedc 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -699,10 +699,6 @@ void SAL_CALL ScVbaControl::setTabIndex( sal_Int32 
/*nTabIndex*/ ) throw (uno::R
 xVBAControl.set( new ScVbaControl( xVbaParent, xContext, xControl, 
xModel, xGeoHelper.release() ) );
 else if ( xServiceInfo-supportsService( com.sun.star.awt.UnoFrameModel 
) )
 xVBAControl.set( new ScVbaFrame( xVbaParent, xContext, xControl, 
xModel, xGeoHelper.release(), xDialog ) );
-else if ( xServiceInfo-supportsService( 
com.sun.star.awt.UnoControlSpinButtonModel ) )
-xVBAControl.set( new ScVbaSpinButton( xVbaParent, xContext, xControl, 
xModel, xGeoHelper.release() ) );
-else if ( xServiceInfo-supportsService( 
com.sun.star.custom.awt.UnoControlSystemAXContainerModel ) )
-xVBAControl.set( new VbaSystemAXControl( xVbaParent, xContext, 
xControl, xModel, xGeoHelper.release() ) );
 if( xVBAControl.is() )
 return xVBAControl;
 throw uno::RuntimeException( Unsupported control. , uno::Reference 
uno::XInterface () );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-05 Thread Caolán McNamara
 vbahelper/source/msforms/vbalistbox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2a149037861c3406f7dd108dd5db4ec969940bff
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 5 21:14:53 2014 +0100

fix colon

Change-Id: Ibeaa20a99d7b027dee26e591bb19bd61a3aed8a2

diff --git a/vbahelper/source/msforms/vbalistbox.cxx 
b/vbahelper/source/msforms/vbalistbox.cxx
index 28aa435..aaa0fba 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -34,7 +34,7 @@ const static OUString ITEMS( StringItemList );
 
 ScVbaListBox::ScVbaListBox( const uno::Reference XHelperInterface  xParent, 
const uno::Reference uno::XComponentContext  xContext, const uno::Reference 
css::uno::XInterface  xControl, const uno::Reference frame::XModel  
xModel, AbstractGeometryAttributes* pGeomHelper )
 : ListBoxImpl_BASE(xParent, xContext, xControl, xModel, pGeomHelper)
-: m_nIndex(0)
+, m_nIndex(0)
 {
 mpListHelper.reset( new ListControlHelper( m_xProps ) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-02 Thread Stephan Bergmann
 vbahelper/source/vbahelper/vbahelper.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 6d20b453b6e667dee18bc456249279805aa08755
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 2 10:52:04 2014 +0200

coverity#1194895 Logically dead code

Change-Id: I24e8ee88a1efdfaa7cedf996bd2d3bb05fbd4dc6

diff --git a/vbahelper/source/vbahelper/vbahelper.cxx 
b/vbahelper/source/vbahelper/vbahelper.cxx
index 5c11fbd..90efa1e 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -515,12 +515,11 @@ ContainerUtilities::getUniqueName( const uno::Sequence 
OUString  _slist, cons
 {
 sal_Int32 a = _nStartSuffix;
 OUString scompname = _sElementName;
-bool bElementexists = true;
 sal_Int32 nLen = _slist.getLength();
 if ( nLen == 0 )
 return _sElementName;
 
-while (bElementexists == true)
+for (;;)
 {
 for (sal_Int32 i = 0; i  nLen; i++)
 {
@@ -531,7 +530,6 @@ ContainerUtilities::getUniqueName( const uno::Sequence 
OUString  _slist, cons
 }
 scompname = _sElementName + _sSuffixSeparator + OUString::number( a++ 
);
 }
-return OUString();
 }
 
 sal_Int32
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-26 Thread Alexander Wilms
 vbahelper/source/msforms/service.cxx |4 ++--
 vbahelper/source/msforms/vbacombobox.hxx |2 +-
 vbahelper/source/msforms/vbalistbox.hxx  |2 +-
 vbahelper/source/msforms/vbalistcontrolhelper.cxx|2 +-
 vbahelper/source/msforms/vbanewfont.cxx  |4 ++--
 vbahelper/source/msforms/vbanewfont.hxx  |4 ++--
 vbahelper/source/vbahelper/vbacommandbarcontrol.cxx  |4 ++--
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |2 +-
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx   |4 ++--
 vbahelper/source/vbahelper/vbahelper.cxx |2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit d304c532e8450d0e68d4275468c2f6ed9a68a6c3
Author: Alexander Wilms f.alexander.wi...@gmail.com
Date:   Tue Feb 25 22:49:25 2014 +0100

Remove visual noise from vbahelper

Change-Id: I068c2a73a3ae487aff7c5451545d3e0aee50b1da
Reviewed-on: https://gerrit.libreoffice.org/8338
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-by: Caolán McNamara caol...@redhat.com

diff --git a/vbahelper/source/msforms/service.cxx 
b/vbahelper/source/msforms/service.cxx
index 5a9120f..1fbde40 100644
--- a/vbahelper/source/msforms/service.cxx
+++ b/vbahelper/source/msforms/service.cxx
@@ -21,9 +21,9 @@
 #include com/sun/star/registry/XRegistryKey.hpp
 #include comphelper/servicedecl.hxx
 
-// 
=
+
 // component exports
-// 
=
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
diff --git a/vbahelper/source/msforms/vbacombobox.hxx 
b/vbahelper/source/msforms/vbacombobox.hxx
index 1edb0fa..e157772 100644
--- a/vbahelper/source/msforms/vbacombobox.hxx
+++ b/vbahelper/source/msforms/vbacombobox.hxx
@@ -87,6 +87,6 @@ public:
 virtual css::uno::SequenceOUString getServiceNames();
 };
 
-#endif //
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalistbox.hxx 
b/vbahelper/source/msforms/vbalistbox.hxx
index a6addc0..1fc0678 100644
--- a/vbahelper/source/msforms/vbalistbox.hxx
+++ b/vbahelper/source/msforms/vbalistbox.hxx
@@ -79,6 +79,6 @@ public:
 
 };
 
-#endif //
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx 
b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
index 70e0b66..1abae82 100644
--- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx
+++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx
@@ -128,7 +128,7 @@ ListControlHelper::AddItem( const uno::Any pvargItem, 
const uno::Any pvargInde
 std::vector OUString ::iterator it = sVec.begin();
 for ( ; pString != pEndString; ++pString, ++it)
 *pString = *it;
-//
+
 }
 
 m_xProps-setPropertyValue( ITEMS, uno::makeAny( sList ) );
diff --git a/vbahelper/source/msforms/vbanewfont.cxx 
b/vbahelper/source/msforms/vbanewfont.cxx
index c4b5472..a2e64f5 100644
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -27,7 +27,7 @@
 using namespace ::com::sun::star;
 using namespace ::ooo::vba;
 
-// 
+
 
 VbaNewFont::VbaNewFont(
 const uno::Reference XHelperInterface  rxParent,
@@ -136,6 +136,6 @@ void SAL_CALL VbaNewFont::setStrikethrough( sal_Bool 
bStrikethrough ) throw (uno
 
 VBAHELPER_IMPL_XHELPERINTERFACE( VbaNewFont, ooo.vba.msforms.NewFont )
 
-// 
+
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/msforms/vbanewfont.hxx 
b/vbahelper/source/msforms/vbanewfont.hxx
index 5ce9409..d948604 100644
--- a/vbahelper/source/msforms/vbanewfont.hxx
+++ b/vbahelper/source/msforms/vbanewfont.hxx
@@ -23,7 +23,7 @@
 #include ooo/vba/msforms/XNewFont.hpp
 #include vbahelper/vbahelperinterface.hxx
 
-// 
+
 
 typedef InheritedHelperInterfaceImpl1 ov::msforms::XNewFont  VbaNewFont_BASE;
 
@@ -60,7 +60,7 @@ private:
 css::uno::Reference css::beans::XPropertySet  mxProps;
 };
 
-// 
+
 
 #endif
 
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx 
b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index f2d3a7d..3f6efe2c 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -193,7 +193,7 @@ ScVbaCommandBarControl::getServiceNames()
 return aServiceNames;
 }
 
- ScVbaCommandBarPopup //
+// ScVbaCommandBarPopup
 ScVbaCommandBarPopup::ScVbaCommandBarPopup( const 

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

2014-01-07 Thread Tor Lillqvist
 vbahelper/source/vbahelper/vbahelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e1b14fa6557f0ded8b5149e28e00861b296dcb34
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Jan 7 10:11:02 2014 +0200

Fix syntax error

Change-Id: I3967658c001479d0adc7a0f60dea97d1c0c64eb2

diff --git a/vbahelper/source/vbahelper/vbahelper.cxx 
b/vbahelper/source/vbahelper/vbahelper.cxx
index 6b184a6..a3bcc51 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -607,7 +607,7 @@ OUString VBAToRegexp(const OUString rIn, bool bForLike )
 case '[':
 case '?':
 case '*':
-sResult.append(('\\');
+sResult.append('\\');
 sResult.append(*start);
 break;
 case ']':
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-02 Thread Tor Lillqvist
 vbahelper/source/msforms/vbalistbox.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 17f7b2798d5e68e81dc4e6b807779d0d2937260d
Author: Tor Lillqvist t...@collabora.com
Date:   Wed Oct 2 21:17:32 2013 +0300

WaE: unused variable

Change-Id: I1d7fdcdeed30288e7fff37c8a68cfe93137b5948

diff --git a/vbahelper/source/msforms/vbalistbox.cxx 
b/vbahelper/source/msforms/vbalistbox.cxx
index 0f9c8b7..41ccb0a 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -82,7 +82,6 @@ ScVbaListBox::setValue( const uno::Any _value ) throw 
(uno::RuntimeException)
 OUString sValue = getAnyAsString( _value );
 uno::Sequence OUString  sList;
 m_xProps-getPropertyValue( ITEMS ) = sList;
-uno::Sequence sal_Int16  nList;
 sal_Int16 nLength = static_castsal_Int16( sList.getLength() );
 sal_Int16 nValue = -1;
 sal_Int16 i = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-16 Thread Tor Lillqvist
 vbahelper/source/msforms/vbanewfont.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 2c4a7fa98383ca46bca9f6c222ac19e0b940b874
Author: Tor Lillqvist t...@iki.fi
Date:   Tue Apr 16 21:26:51 2013 +0300

Add missing #include rtl/tencinfo.h

Change-Id: Ic00146442a679c39d0af4a287cbcf759826f35cd

diff --git a/vbahelper/source/msforms/vbanewfont.cxx 
b/vbahelper/source/msforms/vbanewfont.cxx
index 1880529..c4b5472 100644
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include rtl/tencinfo.h
 #include vbanewfont.hxx
 #include com/sun/star/awt/FontWeight.hpp
 #include com/sun/star/awt/FontSlant.hpp
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-16 Thread Bjoern Michaelsen
 vbahelper/source/msforms/vbanewfont.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6b08209ae4cebe9c71fe5496499f2e9a4d42def3
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Tue Apr 16 20:54:35 2013 +0200

add missing include

diff --git a/vbahelper/source/msforms/vbanewfont.cxx 
b/vbahelper/source/msforms/vbanewfont.cxx
index c4b5472..0acd862 100644
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -19,6 +19,7 @@
 
 #include rtl/tencinfo.h
 #include vbanewfont.hxx
+#include rtl/tencinfo.h
 #include com/sun/star/awt/FontWeight.hpp
 #include com/sun/star/awt/FontSlant.hpp
 #include com/sun/star/awt/FontStrikeout.hpp
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-16 Thread Bjoern Michaelsen
 vbahelper/source/msforms/vbanewfont.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit f789cdaea74e84243bc2e917173c6a750b20
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Tue Apr 16 21:11:18 2013 +0200

Revert add missing include

This reverts commit 6b08209ae4cebe9c71fe5496499f2e9a4d42def3.

diff --git a/vbahelper/source/msforms/vbanewfont.cxx 
b/vbahelper/source/msforms/vbanewfont.cxx
index 0acd862..c4b5472 100644
--- a/vbahelper/source/msforms/vbanewfont.cxx
+++ b/vbahelper/source/msforms/vbanewfont.cxx
@@ -19,7 +19,6 @@
 
 #include rtl/tencinfo.h
 #include vbanewfont.hxx
-#include rtl/tencinfo.h
 #include com/sun/star/awt/FontWeight.hpp
 #include com/sun/star/awt/FontSlant.hpp
 #include com/sun/star/awt/FontStrikeout.hpp
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-07 Thread Julien Nabet
 vbahelper/source/vbahelper/vbapictureformat.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2c77ef2c73e22cec9d035c60cd8cd012354df702
Author: Julien Nabet serval2...@yahoo.fr
Date:   Fri Mar 8 07:44:12 2013 +0100

Assignment of function parameter has no effect outside the function

Change-Id: I5d869414a382e9b96ea403c645a9050372e5e39d

diff --git a/vbahelper/source/vbahelper/vbapictureformat.cxx 
b/vbahelper/source/vbahelper/vbapictureformat.cxx
index d8501a8..96495e1 100644
--- a/vbahelper/source/vbahelper/vbapictureformat.cxx
+++ b/vbahelper/source/vbahelper/vbapictureformat.cxx
@@ -103,7 +103,6 @@ void SAL_CALL
 ScVbaPictureFormat::IncrementContrast( double increment ) throw 
(uno::RuntimeException)
 {
 double nContrast = getContrast();
-nContrast += increment;
 if( increment  0 )
 {
 increment = 0.0;
@@ -112,6 +111,7 @@ ScVbaPictureFormat::IncrementContrast( double increment ) 
throw (uno::RuntimeExc
 {
 increment = 1.0;
 }
+nContrast += increment;
 setContrast( nContrast );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits