[Libreoffice-commits] .: 16 commits - formula/source sc/inc sc/Library_scfilt.mk sc/source

Tor Lillqvist tml at kemper.freedesktop.org
Tue Oct 18 08:27:43 PDT 2011


 formula/source/core/api/FormulaCompiler.cxx |    1 -
 sc/Library_scfilt.mk                        |    2 +-
 sc/inc/scmod.hxx                            |    4 ++--
 sc/source/filter/excel/xestream.cxx         |    2 +-
 sc/source/filter/xml/xmlexprt.cxx           |    1 -
 sc/source/filter/xml/xmlimprt.cxx           |    1 -
 sc/source/ui/inc/autostyl.hxx               |    2 +-
 sc/source/ui/inc/prevloc.hxx                |    2 +-
 sc/source/ui/vba/vbaformatconditions.hxx    |   17 +++++++++++++++++
 sc/source/ui/vba/vbamenubars.cxx            |    3 ---
 sc/source/ui/vba/vbarange.cxx               |    4 ++--
 sc/source/ui/vba/vbaworkbooks.cxx           |    2 +-
 sc/source/ui/vba/vbaworksheet.cxx           |    1 -
 sc/source/ui/view/tabcont.cxx               |    2 +-
 sc/source/ui/view/tabvwsh3.cxx              |    2 +-
 sc/source/ui/view/viewfunc.cxx              |    6 +++---
 16 files changed, 31 insertions(+), 21 deletions(-)

New commits:
commit 1836e37f831dd5da06f12bc34d995610a81b6181
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 18:20:39 2011 +0300

    WaE: unsafe mix of type 'bool' and type 'sal_Bool' in operation

diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index cc19a93..34bd426 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -542,7 +542,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
         case FID_NORMALVIEWMODE:
         case FID_PAGEBREAKMODE:
             {
-                sal_Bool bWantPageBreak = nSlot == FID_PAGEBREAKMODE;
+                bool bWantPageBreak = nSlot == FID_PAGEBREAKMODE;
 
                 // check whether there is an explicit argument, use it
                 const SfxPoolItem* pItem;
commit 354f88b376195003841fc8474a600cf22d8b3a05
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 18:20:16 2011 +0300

    WaE: unsafe mix of type 'bool' and type 'sal_Bool' in operation

diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 6324fb2..dacdb11 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -488,16 +488,16 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rS
             do
             {
                 bAgain = false;
-                sal_Bool bAddEqual = false;
+                bool bAddEqual = false;
                 ScTokenArray* pArrFirst = pArr = aComp.CompileString( aFormula );
-                sal_Bool bCorrected = aComp.IsCorrected();
+                bool bCorrected = aComp.IsCorrected();
                 if ( bCorrected )
                 {   // probieren, mit erster Parser-Korrektur neu zu parsen
                     pArr = aComp.CompileString( aComp.GetCorrectedFormula() );
                 }
                 if ( !pArr->GetCodeError() )
                 {
-                    bAddEqual = sal_True;
+                    bAddEqual = true;
                     aComp.CompileTokenArray();
                     bCorrected |= aComp.IsCorrected();
                 }
commit c4648a4c0f5920f8f070bbbe8f18b165b6b70802
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 18:02:33 2011 +0300

    WaE: '!=' : unsafe mix of type 'bool' and type 'sal_Bool' in operation

diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 676c806..18ec9bb 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -364,7 +364,7 @@ void ScTabControl::UpdateStatus()
     {
         bModified = false;                                          // Selektion
         for (i=0; i<nMaxCnt && !bModified; i++)
-            if ( rMark.GetTableSelect(i) != IsPageSelected(static_cast<sal_uInt16>(i)+1) )
+            if ( rMark.GetTableSelect(i) != (bool) IsPageSelected(static_cast<sal_uInt16>(i)+1) )
                 bModified = sal_True;
 
         // #i99576# the following loop is mis-optimized on unxsoli4 and the reason
commit 52974709b0ddf70e7dce5f85bae2bd1108f64002
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 18:01:06 2011 +0300

    WaE: type name first seen using 'class' now seen using 'struct'

diff --git a/sc/source/ui/inc/prevloc.hxx b/sc/source/ui/inc/prevloc.hxx
index 936803c..3ecdd57 100644
--- a/sc/source/ui/inc/prevloc.hxx
+++ b/sc/source/ui/inc/prevloc.hxx
@@ -49,7 +49,7 @@ class Rectangle;
 class ScAddress;
 class ScRange;
 class ScDocument;
-class ScPreviewLocationEntry;
+struct ScPreviewLocationEntry;
 
 struct ScPreviewColRowInfo
 {
commit 7bbcea33a2aacece2d5f5abe1a97d9e7fc9615f6
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 18:00:49 2011 +0300

    WaE: type name first seen using 'class' now seen using 'struct'

diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx
index cbf2706..3ff5138 100644
--- a/sc/source/ui/inc/autostyl.hxx
+++ b/sc/source/ui/inc/autostyl.hxx
@@ -37,7 +37,7 @@
 
 class ScDocShell;
 class ScRange;
-class ScAutoStyleData;
+struct ScAutoStyleData;
 struct ScAutoStyleInitData;
 
 class ScAutoStyleList
commit a0bbe01a00b22a3fe62a101910564d6576cd3425
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:54:35 2011 +0300

    WaE: type name first seen using 'class' now seen using 'struct'

diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 2bc72fd..e90936b 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -79,8 +79,8 @@ class ScTransferObj;
 class ScDrawTransferObj;
 class ScSelectionTransferObj;
 class ScFormEditData;
-class ScDragData;
-class ScClipData;
+struct ScDragData;
+struct ScClipData;
 
 //==================================================================
 
commit ccc7d23bed33fecdca3c54f973b7cf6f6bd787f4
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:51:48 2011 +0300

    WaE: unreachable code

diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 9c5cb7d..7e6d98a 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2625,7 +2625,6 @@ throw(::com::sun::star::uno::RuntimeException)
         // generic name for 'unknown' cases
         return ScXMLImport_getImplementationName();
     }
-    return SvXMLImport::getImplementationName();
 }
 
 // ::com::sun::star::xml::sax::XDocumentHandler
commit 7fe62b7e040a6c3c8dbed0b140f4ff897737650f
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:49:58 2011 +0300

    WaE: unreachable code

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 4f8ca89..05a5dc0 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4390,7 +4390,6 @@ void SAL_CALL ScXMLExport::initialize( const ::com::sun::star::uno::Sequence< ::
                 return ScXMLOOoExport_getImplementationName();
         }
     }
-    return SvXMLExport::getImplementationName();
 }
 
 sal_Bool SAL_CALL ScXMLExport::supportsService( const ::rtl::OUString& ServiceName )
commit 6e71779cecc26a002243b59f3ad2128922dc4971
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:46:41 2011 +0300

    WaE: C++ exception handler used, but unwind semantics are not enabled
    
    Must use gb_Library_add_noexception_objects instead of
    gb_Library_add_cxxobjects so that -DEXCEPTIONS_OFF is passed to the
    compilation. (In this case, it affects code in
    com/sun/star/uno/genfunc.hxx.)

diff --git a/sc/Library_scfilt.mk b/sc/Library_scfilt.mk
index e6958f4..1038c58 100644
--- a/sc/Library_scfilt.mk
+++ b/sc/Library_scfilt.mk
@@ -165,7 +165,7 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\
         sc/source/filter/xcl97/xcl97rec \
 ))
 
-$(eval $(call gb_Library_add_cxxobjects,scfilt,\
+$(eval $(call gb_Library_add_noexception_objects,scfilt,\
        sc/source/filter/lotus/optab \
 ))
 
commit c1b00df77ed40200d06259d9a07ce77ed335b030
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:39:36 2011 +0300

    WaE: unreachable code

diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 64f25ea..9fbb174 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -395,7 +395,6 @@ ScVbaWorksheet::getEnableSelection() throw (uno::RuntimeException)
         throw uno::RuntimeException(::rtl::OUString(
                                 RTL_CONSTASCII_USTRINGPARAM( "Sheet Name does not exist. ") ),
                                 uno::Reference< XInterface >() );
-    return excel::XlEnableSelection::xlNoSelection;
 }
 
 
commit 93ea3566d2d98a5eb2b6b3d8d315f4e0384ca1cc
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:37:11 2011 +0300

    WaE: illegal copy-initialization
    
    warning C4928: illegal copy-initialization; more than one user-defined
    conversion has been implicitly applied. So use a variable of the
    correct type, should not affect the intent of the code.

diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx
index 39f6f66..e513c22 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -82,7 +82,7 @@ getWorkbook( uno::Reference< uno::XComponentContext >& xContext, const uno::Refe
     if ( pShell )
     {
         String sCodeName = pShell->GetDocument()->GetCodeName();
-        uno::Reference< uno::XInterface > xIf = getUnoDocModule( sCodeName, pShell );
+        uno::Reference< XHelperInterface > xIf = getUnoDocModule( sCodeName, pShell );
                 if ( xIf.is() )
                 {
                     OSL_TRACE(" *** Returning Module uno Object *** ");
commit ab988bf0557e26a8e09c98a92295f26acaee7a50
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 17:15:12 2011 +0300

    WaE: unreachable code

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index da3682e..d880920 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -127,7 +127,6 @@ short lcl_GetRetFormat( OpCode eOpCode )
         default:
             return NUMBERFORMAT_NUMBER;
     }
-    return NUMBERFORMAT_NUMBER;
 }
 
 inline void lclPushOpCodeMapEntry( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVec, const String* pTable, sal_uInt16 nOpCode )
commit 88fcd2c05a037413550ea42f952d330f1b805c78
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 15:02:19 2011 +0300

    WaE: unreferenced local variable

diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index f4091c8..fe8c9df 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4608,7 +4608,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
             uno::Any aConverted = xConverter->convertTo( Field, getCppuType( (sal_Int32*)0 ) );
             bIsValidFieldValue = ( aConverted >>= nField );
         }
-        catch( const uno::Exception& ex )
+        catch( const uno::Exception& )
         {
         }
     }
@@ -4651,7 +4651,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const
                 uno::Any aConverted = xConverter->convertTo( Operator, getCppuType( (sal_Int32*)0 ) );
                 bIsValidOpValue = ( aConverted >>= nOperator );
             }
-            catch( const uno::Exception& ex )
+            catch( const uno::Exception& )
             {
             }
         }
commit de4d4273f805c43e1c71da4be1b9a0799bab80c4
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 10:52:16 2011 +0300

    WaE: unreachable code

diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx
index 1c06e73..ec18591 100644
--- a/sc/source/ui/vba/vbamenubars.cxx
+++ b/sc/source/ui/vba/vbamenubars.cxx
@@ -59,7 +59,6 @@ public:
         }
         else
             throw container::NoSuchElementException();
-        return uno::Any();
     }
 };
 
@@ -114,8 +113,6 @@ ScVbaMenuBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw
     }
 
     throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
-
-    return uno::Any();
 }
 
 // XHelperInterface
commit adcf15c865692ed9071a971d5c0adc2ca49e4e0c
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 10:50:35 2011 +0300

    WaE: 'ScVbaFormatConditions' : default constructor could not be generated
    
    The ScVbaFormatConditions class is used only as a target for casting,
    it seems, and no objects of this type are created as such, I think.
    So avoid MSVC warnings:
    
    warning C4510: 'ScVbaFormatConditions' : default constructor could not
    be generated
    
    warning C4610: class 'ScVbaFormatConditions' can never be instantiated
    - user defined constructor required

diff --git a/sc/source/ui/vba/vbaformatconditions.hxx b/sc/source/ui/vba/vbaformatconditions.hxx
index 01570c1..e191e27 100644
--- a/sc/source/ui/vba/vbaformatconditions.hxx
+++ b/sc/source/ui/vba/vbaformatconditions.hxx
@@ -36,6 +36,19 @@
 #include <vbahelper/vbacollectionimpl.hxx>
 
 typedef CollTestImplHelper< ov::excel::XFormatConditions > ScVbaFormatConditions_BASE;
+
+// This class is used only as a target for casting, it seems,
+// and no objects of this type are created as such, I think.
+// So avoid MSVC warnings:
+// warning C4510: 'ScVbaFormatConditions' : default constructor could not be generated
+// warning C4610: class 'ScVbaFormatConditions' can never be instantiated - user defined constructor required
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4510)
+#pragma warning(disable: 4610)
+#endif
+
 class ScVbaFormatConditions: public ScVbaFormatConditions_BASE
 {
     css::table::CellAddress maCellAddress;
@@ -62,6 +75,10 @@ public:
     virtual css::uno::Sequence<rtl::OUString> getServiceNames();
 };
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif //SC_VBA_AXES_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit bbe2a8674623c6a30f483040f114c754e67476ca
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 18 09:59:18 2011 +0300

    WaE: reinterpret_cast used between related classes, so use static_cast

diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index c937489..8d71190 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1104,7 +1104,7 @@ ScDocShell* XclExpXmlStream::getDocShell()
     ScModelObj *pObj = dynamic_cast < ScModelObj* >( xModel.get() );
 
     if ( pObj )
-        return reinterpret_cast < ScDocShell* >( pObj->GetEmbeddedObject() );
+        return static_cast < ScDocShell* >( pObj->GetEmbeddedObject() );
 
     return 0;
 }


More information about the Libreoffice-commits mailing list