[Libreoffice-commits] core.git: 60 commits - chart2/source comphelper/source connectivity/source cui/source editeng/source extensions/source filter/source framework/source hwpfilter/source include/svx oox/source sax/source sc/source sdext/source sd/source sfx2/source soltools/cpp svx/source sw/source vcl/source vcl/unx writerfilter/source

Caolán McNamara caolanm at redhat.com
Thu Oct 2 06:49:40 PDT 2014


 chart2/source/view/main/OpenGLRender.cxx                |    2 
 chart2/source/view/main/VLegendSymbolFactory.cxx        |    2 
 comphelper/source/misc/syntaxhighlight.cxx              |    2 
 connectivity/source/drivers/dbase/DTable.cxx            |    6 +-
 cui/source/dialogs/iconcdlg.cxx                         |   34 ---------------
 cui/source/tabpages/numfmt.cxx                          |    4 -
 cui/source/tabpages/tpbitmap.cxx                        |    2 
 cui/source/tabpages/tpline.cxx                          |    7 ++-
 cui/source/tabpages/tplnedef.cxx                        |   10 ++--
 cui/source/tabpages/tplneend.cxx                        |    7 ++-
 editeng/source/misc/txtrange.cxx                        |    1 
 extensions/source/scanner/sane.cxx                      |    6 --
 filter/source/msfilter/escherex.cxx                     |    2 
 framework/source/layoutmanager/layoutmanager.cxx        |    3 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |    4 -
 hwpfilter/source/hcode.cxx                              |    8 +--
 include/svx/numfmtsh.hxx                                |    6 +-
 oox/source/drawingml/effectproperties.cxx               |    2 
 sax/source/expatwrap/saxwriter.cxx                      |   31 +++++++++----
 sax/source/expatwrap/xml2utf.cxx                        |    1 
 sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx  |    2 
 sc/source/ui/dbgui/scuiasciiopt.cxx                     |    4 +
 sc/source/ui/miscdlgs/datafdlg.cxx                      |    7 +++
 sc/source/ui/miscdlgs/inscodlg.cxx                      |    7 ++-
 sc/source/ui/view/formatsh.cxx                          |    2 
 sc/source/ui/view/output2.cxx                           |    2 
 sd/source/core/drawdoc3.cxx                             |   11 ++--
 sd/source/filter/eppt/epptso.cxx                        |   10 ++--
 sd/source/filter/html/pubdlg.cxx                        |    2 
 sdext/source/presenter/PresenterHelpView.cxx            |    4 -
 sfx2/source/appl/appserv.cxx                            |   11 +---
 sfx2/source/control/templatecontaineritem.cxx           |    4 -
 sfx2/source/dialog/backingwindow.cxx                    |    2 
 sfx2/source/doc/objstor.cxx                             |    4 -
 sfx2/source/doc/sfxbasemodel.cxx                        |    3 -
 sfx2/source/view/frame.cxx                              |    5 --
 soltools/cpp/_tokens.c                                  |    2 
 svx/source/engine3d/obj3d.cxx                           |    2 
 svx/source/engine3d/scene3d.cxx                         |    2 
 svx/source/items/numfmtsh.cxx                           |   11 +---
 svx/source/svdraw/svdobj.cxx                            |    2 
 sw/source/core/SwNumberTree/SwNumberTree.cxx            |    5 --
 sw/source/core/draw/dflyobj.cxx                         |    4 -
 sw/source/filter/html/swhtml.cxx                        |   36 +++++++++-------
 sw/source/uibase/shells/annotsh.cxx                     |    1 
 sw/source/uibase/shells/drwtxtex.cxx                    |    1 
 sw/source/uibase/sidebar/PagePropertyPanel.cxx          |    4 +
 vcl/source/app/svapp.cxx                                |    9 +---
 vcl/source/filter/sgvtext.cxx                           |    4 -
 vcl/source/gdi/print.cxx                                |    5 +-
 vcl/source/window/floatwin.cxx                          |   15 ++++++
 vcl/unx/generic/gdi/salbmp.cxx                          |    5 --
 vcl/unx/gtk/a11y/atktextattributes.cxx                  |    2 
 writerfilter/source/dmapper/BorderHandler.cxx           |    2 
 writerfilter/source/dmapper/CellMarginHandler.cxx       |    2 
 writerfilter/source/dmapper/TDefTableHandler.cxx        |    2 
 56 files changed, 170 insertions(+), 166 deletions(-)

New commits:
commit f1694b3f189c0893d7987bcb19f1c682c7afc368
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:29:45 2014 +0100

    coverity#1158274 Uncaught exception
    
    Change-Id: Icfbe30efa3ebd63620a900e345e4b4a74070b021

diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 79374ab..b662916 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -23,6 +23,7 @@
 #include <set>
 #include <stack>
 
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/util/XCloneable.hpp>
@@ -891,17 +892,27 @@ public: // XActiveDataSource
     virtual void SAL_CALL setOutputStream(const Reference< XOutputStream > & aStream)
         throw (RuntimeException, std::exception) SAL_OVERRIDE
     {
-        // temporary: set same stream again to clear buffer
-        if ( m_out == aStream && m_pSaxWriterHelper && m_bDocStarted )
-            m_pSaxWriterHelper->clearBuffer();
-        else
+        try
+        {
+            // temporary: set same stream again to clear buffer
+            if ( m_out == aStream && m_pSaxWriterHelper && m_bDocStarted )
+                m_pSaxWriterHelper->clearBuffer();
+            else
+            {
+                m_out = aStream;
+                delete m_pSaxWriterHelper;
+                m_pSaxWriterHelper = new SaxWriterHelper(m_out);
+                m_bDocStarted = false;
+                m_nLevel = 0;
+                m_bIsCDATA = false;
+            }
+        }
+        catch (const SAXException& e)
         {
-            m_out = aStream;
-            delete m_pSaxWriterHelper;
-            m_pSaxWriterHelper = new SaxWriterHelper(m_out);
-            m_bDocStarted = false;
-            m_nLevel = 0;
-            m_bIsCDATA = false;
+            throw css::lang::WrappedTargetRuntimeException(
+                   e.Message,
+                   static_cast < OWeakObject * > ( this ),
+                   e.WrappedException);
         }
     }
     virtual Reference< XOutputStream >  SAL_CALL getOutputStream(void)
commit fd8682cc34826229f67d51c387f6f6aa0b2c228a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:24:31 2014 +0100

    fix indent
    
    Change-Id: Ife7b28fcb67051c41831ef9eb566c3a2c148033d

diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 819c06b..79374ab 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -890,25 +890,25 @@ public:
 public: // XActiveDataSource
     virtual void SAL_CALL setOutputStream(const Reference< XOutputStream > & aStream)
         throw (RuntimeException, std::exception) SAL_OVERRIDE
-            {
-                // temporary: set same stream again to clear buffer
-                if ( m_out == aStream && m_pSaxWriterHelper && m_bDocStarted )
-                    m_pSaxWriterHelper->clearBuffer();
-                else
-                {
-
-                m_out = aStream;
-                delete m_pSaxWriterHelper;
-                m_pSaxWriterHelper = new SaxWriterHelper(m_out);
-                m_bDocStarted = false;
-                m_nLevel = 0;
-                m_bIsCDATA = false;
-
-                }
-            }
+    {
+        // temporary: set same stream again to clear buffer
+        if ( m_out == aStream && m_pSaxWriterHelper && m_bDocStarted )
+            m_pSaxWriterHelper->clearBuffer();
+        else
+        {
+            m_out = aStream;
+            delete m_pSaxWriterHelper;
+            m_pSaxWriterHelper = new SaxWriterHelper(m_out);
+            m_bDocStarted = false;
+            m_nLevel = 0;
+            m_bIsCDATA = false;
+        }
+    }
     virtual Reference< XOutputStream >  SAL_CALL getOutputStream(void)
         throw(RuntimeException, std::exception) SAL_OVERRIDE
-            { return m_out; }
+    {
+        return m_out;
+    }
 
 public: // XDocumentHandler
     virtual void SAL_CALL startDocument(void)
commit 5717312686aeeeabdf09635cf44d5c46a023c8bd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:23:23 2014 +0100

    consistent capitalization in both exceptions
    
    Change-Id: I495a92c24847de265f04abb3670532270b5d6034

diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 0409240..819c06b 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -197,7 +197,7 @@ inline sal_uInt32 SaxWriterHelper::writeSequence() throw( SAXException )
         Any a;
         a <<= e;
         throw SAXException(
-            "io exception during writing",
+            "IO exception during writing",
             Reference< XInterface > (),
             a );
     }
commit 9e8701c71186c5357dddf8e38763426fc183b08e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:20:15 2014 +0100

    coverity#1233618 Overlapping buffer in memory copy
    
    Change-Id: I062dd96bfc4abf2bdaec2c17d1cf57d853d655d8

diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c
index bd75a01..e31ccbd 100644
--- a/soltools/cpp/_tokens.c
+++ b/soltools/cpp/_tokens.c
@@ -492,7 +492,7 @@ void
         {
             if ( write(1, wbuf, OBS) != -1 ) {
             if (wbp > &wbuf[OBS])
-                memcpy(wbuf, wbuf + OBS, wbp - &wbuf[OBS]);
+                memmove(wbuf, wbuf + OBS, wbp - &wbuf[OBS]);
             wbp -= OBS;
         }
         else exit(1);
commit a7232e3f54c0c2ff1cb65d5d00027427ebb1016a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:17:03 2014 +0100

    coverity#1242520 silence Arguments in wrong order
    
    Change-Id: I88b96d42f5ee96641dc21e3e55415f6dc32b3951

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 3f23530..eef8ac7 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1025,7 +1025,9 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt )
         // vertical. Therefore, we need to put down it BEFORE THE ROTATION.
         ::com::sun::star::awt::Point
             aTopLeft( (sal_Int32)( maRect.Left() + fWidthHalf - fHeightHalf ), (sal_Int32)( maRect.Top() + fHeightHalf - fWidthHalf ) );
-        Size    aNewSize( maRect.GetHeight(), maRect.GetWidth() );
+        const long nRotatedWidth(maRect.GetHeight());
+        const long nRotatedHeight(maRect.GetWidth());
+        const Size aNewSize(nRotatedWidth, nRotatedHeight);
         maRect = Rectangle( Point( aTopLeft.X, aTopLeft.Y ), aNewSize );
     }
 }
commit 51e81c91e9fdb08a10160964b2a638c7fa065f2d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:14:22 2014 +0100

    coverity#1242512 silence Arguments in wrong order
    
    Change-Id: Ic4e337a17a8149137ff82a64e5513460c36373a0

diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
index 6b4f274..fcc9d45 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
@@ -287,7 +287,9 @@ void PagePropertyPanel::ExecuteOrientationChange( const bool bLandscape )
         mpPageItem->SetLandscape( bLandscape );
 
         // swap the width and height of the page size
-        mpPageSizeItem->SetSize( Size( mpPageSizeItem->GetSize().Height(), mpPageSizeItem->GetSize().Width() ) );
+        const long nRotatedWidth = mpPageSizeItem->GetSize().Height();
+        const long nRotatedHeight = mpPageSizeItem->GetSize().Width();
+        mpPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight));
 
         // apply changed attributes
         GetBindings()->GetDispatcher()->Execute( SID_ATTR_PAGE_SIZE, SFX_CALLMODE_RECORD, mpPageSizeItem.get(), mpPageItem.get(), 0L );
commit d2cf2d813befa4cfb2f709fcb8bc60ba85cf314a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:11:12 2014 +0100

    coverity#1242507 silence Arguments in wrong order
    
    Change-Id: Ice857b6f97f1ac3f720226aa90392fb6e9229869

diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index ae62b39..960c6ca 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1377,8 +1377,9 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
          nLandscapeAngle != 0 &&
          HasSupport( SUPPORT_SET_ORIENTATION ))
     {
-
-        PaperInfo aRotatedInfo(pSetupData->mnPaperHeight, pSetupData->mnPaperWidth);
+        const long nRotatedWidth = pSetupData->mnPaperHeight;
+        const long nRotatedHeight = pSetupData->mnPaperWidth;
+        PaperInfo aRotatedInfo(nRotatedWidth, nRotatedHeight);
 
         for ( int i = 0; i < nPaperCount; i++ )
         {
commit 154cc4ab52f4fd364889b6333338f5dd880352e2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:08:44 2014 +0100

    coverity#1242506 silence Arguments in wrong order
    
    order doesn't matter one bit as far as I can see
    
    Change-Id: I55aa5d23d9865a47ef4dcda9d3e19863794a18c9

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index a2159a2..bbf1c38 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -883,7 +883,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
                             SfxItemSet& rNewSet = pStyleSheet->GetItemSet();
                             bool bNumFormatChanged;
                             if ( ScGlobal::CheckWidthInvalidate(
-                                                bNumFormatChanged, aOldSet, rNewSet ) )
+                                                bNumFormatChanged, rNewSet, aOldSet ) )
                                 rDoc.InvalidateTextWidth( NULL, NULL, bNumFormatChanged );
 
                             SCTAB nTabCount = rDoc.GetTableCount();
commit 67693ad0d41c5e421045b2ff5f66ce936e05c583
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:05:44 2014 +0100

    coverity#1130190 'Constant' variable guards dead code
    
    Change-Id: Ifc462622919c8247c1f4ff8304f3107a23ef1c49

diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
index 7a76c2f..4a43e79 100644
--- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
@@ -62,7 +62,7 @@ ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell)
         pIterator.reset(new DataRangeByRowIterator(mInputRange));
 
     sal_Int32 aIntervalSize = mpIntervalSpin->GetValue();
-    bool aCentral = true;
+    const bool aCentral = true; //to-do add support to change this to the dialog
 
     for( ; pIterator->hasNext(); pIterator->next() )
     {
commit 31c407e35bb57adaba338205b6a40301d28d804f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 14:04:58 2014 +0100

    coverity#735532 'Constant' variable guards dead code
    
    Change-Id: Ia0b8ad6af83907a51678e37e41c445fa4a7b5a58

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index ead0539..3b3bfdf 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2434,22 +2434,28 @@ void SwHTMLParser::AddParSpace()
             const size_t nCntAttr = (pTxtNode  && pTxtNode->GetpSwpHints())
                             ? pTxtNode->GetSwpHints().Count() : 0;
 
-            for(size_t i = 0; (i < nCntAttr) && !bIsCJK; ++i)
+            for(size_t i = 0; i < nCntAttr; ++i)
             {
-               pHt = rHints.GetTextHint(i);
-               nWhich = pHt->Which();
-               if( RES_CHRATR_CJK_FONT == nWhich ||
-                   RES_CHRATR_CJK_FONTSIZE == nWhich ||
-                   RES_CHRATR_CJK_LANGUAGE == nWhich ||
-                   RES_CHRATR_CJK_POSTURE == nWhich ||
-                   RES_CHRATR_CJK_WEIGHT == nWhich )
-                       bIsCJK = true;
-               if( RES_CHRATR_CTL_FONT == nWhich ||
-                   RES_CHRATR_CTL_FONTSIZE == nWhich ||
-                   RES_CHRATR_CTL_LANGUAGE == nWhich ||
-                   RES_CHRATR_CTL_POSTURE == nWhich ||
-                   RES_CHRATR_CTL_WEIGHT == nWhich )
-                       bIsCJK = false;
+                pHt = rHints.GetTextHint(i);
+                nWhich = pHt->Which();
+                if (RES_CHRATR_CJK_FONT == nWhich ||
+                    RES_CHRATR_CJK_FONTSIZE == nWhich ||
+                    RES_CHRATR_CJK_LANGUAGE == nWhich ||
+                    RES_CHRATR_CJK_POSTURE == nWhich ||
+                    RES_CHRATR_CJK_WEIGHT == nWhich)
+                {
+                    bIsCJK = true;
+                    break;
+                }
+                if (RES_CHRATR_CTL_FONT == nWhich ||
+                    RES_CHRATR_CTL_FONTSIZE == nWhich ||
+                    RES_CHRATR_CTL_LANGUAGE == nWhich ||
+                    RES_CHRATR_CTL_POSTURE == nWhich ||
+                    RES_CHRATR_CTL_WEIGHT == nWhich)
+                {
+                    bIsCTL = true;
+                    break;
+                }
             }
 
             if( bIsCTL )
commit 5d796ae7f4e742665b6aaa722d13f0611023ec44
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 13:59:19 2014 +0100

    coverity#1169811 'Constant' variable guards dead code
    
    Change-Id: I1c795134469c0ab8cf6591982e2a44a6506e4fc5

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index b12dba5..204b2e8 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -937,7 +937,7 @@ void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadiu
     double nAngleStep = 1;
     PointList aPointList;
     // TODO: moggi: GL_TRIANGLE_FAN seems not to work
-    bool bInnerRadiusNotZero = true; //!rtl::math::approxEqual(0.0, fInnerRadius);
+    const bool bInnerRadiusNotZero = true; //!rtl::math::approxEqual(0.0, fInnerRadius);
     size_t nVectorSize = 3*(nAngleWidth/nAngleStep);
     if(bInnerRadiusNotZero)
         nVectorSize *= 2;
commit 9403f75f44df4fd33224b0830eebcb55d056295b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 13:57:52 2014 +0100

    coverity#1202776 'Constant' variable guards dead code
    
    Change-Id: Ib1d5dcc8b09e11a8ef2399e3ef1a5ae1769de90f

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 2f6961b..4a6bc3d 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -670,7 +670,7 @@ void EscherPropertyContainer::CreateTextProperties(
 
     // used with normal shapes:
     bool bAutoGrowWidth     ( false );
-    bool bAutoGrowHeight    ( false );
+    const bool bAutoGrowHeight    ( false ); //#ii63936 not setting autogrowheight, because minframeheight would be ignored
     // used with ashapes:
     bool bWordWrap          ( false );
     bool bAutoGrowSize      ( false );
commit b3e87789d9b31f039b2e7b6a23f312c03712777b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:32:59 2014 +0100

    coverity#1242475 no point calling SetText with GetText results
    
    Change-Id: I0ebd4a53a0d309b45f5af31adc6fa54a5f143a21

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index b5101c3..00d4f16 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -277,8 +277,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, const OUString& aDatNa
             break;
         case SC_IMPORTFILE:
             aName += " - [" + aDatName + "]";
-        default:
             SetText( aName );
+            break;
+        default:
+            break;
     }
 
     // To be able to prefill the correct values based on the file extension
commit 227d87d805cf0aee28a0faedff67dcb6b0e6ce2d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:28:26 2014 +0100

    coverity#1242476 Dereference null return value
    
    Change-Id: I1895537459bca9341d1e97bad7ca38813bdfa2fe

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 2e2c039..a7c1219 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2997,7 +2997,7 @@ void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUn
     // I think this may never happen... But I am not sure enough .-)
     if ( bTransferOwnership )
     {
-        if ( _rxUnoShape.is() )
+        if (mpSvxShape)
             mpSvxShape->TakeSdrObjectOwnership();
         SAL_WARN( "svx.uno", "a UNO shape took over an SdrObject previously owned by another UNO shape!");
     }
commit 1c53c50662e5b7debbfb59307f10c2ed81af8f41
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:25:23 2014 +0100

    coverity#735574 'Constant' variable guards dead code
    
    Change-Id: Ifcb8078e3e52c1b3634ab1c6ad6d6121502950d9

diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx
index 58b551d..0f64482 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.cxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.cxx
@@ -332,7 +332,7 @@ void TDefTableHandler::localResolve(Id rName, writerfilter::Reference<Properties
         table::BorderLine2 aBorderLine;
         ConversionHelper::MakeBorderLine( m_nLineWidth,   m_nLineType, m_nLineColor,
                                                                         aBorderLine, m_bOOXML );
-        bool rtl = false; // TODO
+        const bool rtl = false; // TODO
         switch( rName )
         {
             case NS_ooxml::LN_CT_TcBorders_top:
commit 38b6c13f08232813d60316dc86d94fa89f32cf92
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:24:50 2014 +0100

    coverity#735572 'Constant' variable guards dead code
    
    Change-Id: I07e350a87ee58ba1dd032f2e5cffc8a05ebce029

diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx
index 6bbb525..7cba3e1 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.cxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.cxx
@@ -98,7 +98,7 @@ void CellMarginHandler::lcl_sprm(Sprm & rSprm)
     if( pProperties.get())
     {
         pProperties.get()->resolve( *this );
-        bool rtl = false; // TODO
+        const bool rtl = false; // TODO
         switch( rSprm.getId() )
         {
             case NS_ooxml::LN_CT_TblCellMar_top:
commit be9f02f1b41a34a93c61f97cbc7887c0c320f5e0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:24:03 2014 +0100

    coverity#735571 'Constant' variable guards dead code
    
    Change-Id: Idd3654f45a9fe9c0a92aa88b494cdd9192baa966

diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index 68418b8..036b52d 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -91,7 +91,7 @@ void BorderHandler::lcl_attribute(Id rName, Value & rVal)
 void BorderHandler::lcl_sprm(Sprm & rSprm)
 {
     BorderPosition pos = BORDER_COUNT; // invalid pos
-    bool rtl = false; // TODO detect
+    const bool rtl = false; // TODO detect
     OUString aBorderPos;
     switch( rSprm.getId())
     {
commit 850b8dc7a2116647da30b45a60d8d8ef12214545
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:17:54 2014 +0100

    coverity#1242483 Unintentional integer overflow
    
    Change-Id: Ie258b4b6d4d99c7b2b0d61550a840539b216d09f

diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index c997bc6..e68078e 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -343,9 +343,8 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB(
             else if( aSrcBuf.mnBitCount <= 8 )
             {
                 const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
-                const sal_uInt16 nCols = std::min( (sal_uLong)rColMap.GetUsed()
-                                            , (sal_uLong)(1 << nDrawableDepth)
-                                            );
+                const sal_uInt16 nCols = std::min((sal_uLong)rColMap.GetUsed(),
+                                                  sal_uLong(1) << nDrawableDepth);
 
                 rPal.SetEntryCount( nCols );
                 pDstPal = &rPal;
commit ba8469f6ef8525ea15a5fd749b2389b6853cf1e5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:15:56 2014 +0100

    coverity#1242494 Resource leak
    
    Change-Id: I4956890da9978381e2de7e8b1af37495884d4965

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 2798d3f..fd5806c 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1403,13 +1403,12 @@ UnoWrapperBase* Application::GetUnoWrapper( bool bCreateIfNotExist )
     if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
     {
 #ifndef DISABLE_DYNLOADING
+        osl::Module aTkLib;
         OUString aLibName(TK_DLL_NAME);
-        oslModule hTkLib = osl_loadModuleRelative(
-            &thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
-        if ( hTkLib )
+        aTkLib.loadRelative(&thisModule, aLibName, SAL_LOADMODULE_DEFAULT);
+        if (aTkLib.is())
         {
-            OUString aFunctionName( "CreateUnoWrapper" );
-            FN_TkCreateUnoWrapper fnCreateWrapper = (FN_TkCreateUnoWrapper)osl_getFunctionSymbol( hTkLib, aFunctionName.pData );
+            FN_TkCreateUnoWrapper fnCreateWrapper = (FN_TkCreateUnoWrapper)aTkLib.getFunctionSymbol("CreateUnoWrapper");
             if ( fnCreateWrapper )
             {
                 pSVData->mpUnoWrapper = fnCreateWrapper();
commit 37f62f86aff64b94ca4a8cb34df6cfda216da3bf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:13:28 2014 +0100

    coverity#1242496 Resource leak
    
    Change-Id: I419b217df306d41ed99e603bae9381f54c633598

diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 480a1d7..e379ed0 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1571,10 +1571,12 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
                         DBG_ASSERT(bTest, "Renaming StyleSheet failed.");
                         pMySheet->GetItemSet().ClearItem(0);  // Delete all
 
-                        StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this,
-                                                                 pMySheet, &pHisSheet->GetItemSet());
                         if (bUndo)
+                        {
+                            StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this,
+                                                                 pMySheet, &pHisSheet->GetItemSet());
                             pUndoMgr->AddUndoAction(pUndoChStyle);
+                        }
                         pMySheet->GetItemSet().Put(pHisSheet->GetItemSet());
                         pMySheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
                     }
commit ef6a120af64b5d64e6194c3e538ab6f6f73d4bc8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:12:40 2014 +0100

    coverity#1242497 Resource leak
    
    Change-Id: I2c4295c7d308257290aaf04181805d7dc71d6553

diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index c5b6fa9..480a1d7 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1643,13 +1643,12 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
                 mxStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL);
             }
 
-            if( !aCreatedStyles.empty() )
+            if (bUndo && !aCreatedStyles.empty())
             {
                 // Add UndoAction for creating and inserting the stylesheets to
                 // the top of the UndoManager
                 SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction( this, aCreatedStyles, true);
-                if (bUndo)
-                    pUndoMgr->AddUndoAction(pMovStyles);
+                pUndoMgr->AddUndoAction(pMovStyles);
             }
         }
 
commit b99aad6cc20384c735a19c3530d0ad64ca664954
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:10:51 2014 +0100

    coverity#1242501 Resource leak
    
    Change-Id: I0c684565e2d5e83d7d1bb99b3d8011a1d87994d5

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 274ce98..13370f4 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -845,16 +845,13 @@ extern "C" void basicide_macro_organizer( sal_Int16 );
 OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, bool bChooseOnly, const OUString& rMacroDesc = OUString() )
 {
 #ifndef DISABLE_DYNLOADING
-    // get basctl dllname
-    static OUString aLibName( SVLIBRARY( "basctl"  ) );
+    osl::Module aMod;
 
-    // load module
-    oslModule handleMod = osl_loadModuleRelative(
-        &thisModule, aLibName.pData, 0 );
+    // load basctl module
+    aMod.loadRelative(&thisModule, SVLIBRARY("basctl"), 0);
 
     // get symbol
-    OUString aSymbol( "basicide_choose_macro"  );
-    basicide_choose_macro pSymbol = (basicide_choose_macro) osl_getFunctionSymbol( handleMod, aSymbol.pData );
+    basicide_choose_macro pSymbol = (basicide_choose_macro) aMod.getFunctionSymbol("basicide_choose_macro");
     SAL_WARN_IF(!pSymbol, "sfx.doc", "SfxApplication::MacroOrganizer, no symbol!");
     if (!pSymbol)
         return OUString();
commit 11f2f713843f2ade0355970b2d7f3ba94e49ea6c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:05:10 2014 +0100

    coverity#1242750 Unused value
    
    Change-Id: I057434339e6aee710ba9fa7b6a2cc6a51a5206cf

diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 6d040eb..c3059ebd 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -128,7 +128,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
             aOldSelection = pOLV->GetSelection();
             if (!pOLV->GetEditView().HasSelection())
             {
-                bRestoreSelection   = true;
                 pOLV->GetEditView().SelectCurrentWord();
             }
 
commit 1914fd354f3da110d43debdd2aaf4fa31940a147
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:04:06 2014 +0100

    coverity#1242751 Uninitialized scalar field
    
    Change-Id: Ib56544cf49d53952c7381512b650633abac047e9

diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 460fd58..8a5f232 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -23,6 +23,13 @@
 ScDataFormDlg::ScDataFormDlg(vcl::Window* pParent, ScTabViewShell* pTabViewShellOri)
     : ModalDialog(pParent, "DataFormDialog", "modules/scalc/ui/dataform.ui")
     , pTabViewShell(pTabViewShellOri)
+    , aColLength(0)
+    , nCurrentRow(0)
+    , nStartCol(0)
+    , nEndCol(0)
+    , nStartRow(0)
+    , nEndRow(0)
+    , nTab(0)
     , bNoSelection(false)
 {
     get(m_pBtnNew, "new");
commit 76563eb45bc1fb143aa6b2cdfbcd72bb9f95816b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 11:02:25 2014 +0100

    coverity#1242752 Uninitialized pointer field
    
    Change-Id: I3485a29fe5ce88834b2ef0d30b9c32516befa0ff

diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index a71ce58..5fed72e 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -60,6 +60,7 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage
               , &rInAttrs ),
     rOutAttrs           ( rInAttrs ),
     pPolyObj            ( NULL ),
+    bObjSelected        ( false ),
 
     pXPool              ( (XOutdevItemPool*) rInAttrs.GetPool() ),
     aXLStyle            ( XLINE_SOLID ),
@@ -67,7 +68,11 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage
     aXColor             ( OUString(), COL_BLACK ),
     aXLineAttr          ( pXPool ),
     rXLSet              ( aXLineAttr.GetItemSet() ),
-    pLineEndList        ( NULL )
+    pLineEndList        ( NULL ),
+    pnLineEndListState  ( NULL ),
+    pPageType           ( NULL ),
+    nDlgType            ( 0 ),
+    pPosLineEndLb       ( NULL )
 {
     get(m_pEdtName,"EDT_NAME");
     get(m_pLbLineEnds,"LB_LINEENDS");
commit 205a00d04be2a0a8f64099e6cf17a729c1a76dd5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:59:23 2014 +0100

    coverity#1242766 Unused value
    
    Change-Id: If7d33882d612788fba051ebae56468b80e96e09f

diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index b0e5571..4d74031 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -449,7 +449,6 @@ long SvxBitmapTabPage::CheckChanges_Impl()
                 case RET_BTN_2:
                 {
                     ClickAddHdl_Impl( this );
-                    nPos = m_pLbBitmaps->GetSelectEntryPos();
                 }
                 break;
 
commit ddfb875ba21fb1361d40be26e21939ba95b29f5d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:58:20 2014 +0100

    coverity#1242768 Unused value
    
    Change-Id: Ida66a4a4d00caa49e993938f86e357e4351a60c5

diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index af6cb61..ad8187d 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -752,7 +752,6 @@ void LayoutManager::implts_updateUIElementsVisibleState( bool bSetVisible )
     MenuBarManager*           pInplaceMenuBar( m_pInplaceMenuBar );
     aWriteLock.clear();
 
-    bool bMustDoLayout(false);
     if (( xMenuBar.is() || xInplaceMenuBar.is() ) && xContainerWindow.is() )
     {
         SolarMutexGuard aGuard;
@@ -773,10 +772,10 @@ void LayoutManager::implts_updateUIElementsVisibleState( bool bSetVisible )
                 pSysWindow->SetMenuBar(pMenuBar, m_xFrame);
             else
                 pSysWindow->SetMenuBar( 0 );
-            bMustDoLayout = true;
         }
     }
 
+    bool bMustDoLayout;
     // Hide/show the statusbar according to bSetVisible
     if ( bSetVisible )
         bMustDoLayout = !implts_showStatusBar();
commit 8559539c5607b8345de4baa2a9de806d955815e9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:56:41 2014 +0100

    coverity#1242776 Unused value
    
    Change-Id: Ia84bfbcdd4de08c9e87c877b3c1be84c0b712a07

diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 122a339..b85829c 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -717,46 +717,12 @@ bool IconChoiceDialog::QueryClose()
     return bRet;
 }
 
-
-
 void IconChoiceDialog::Start_Impl()
 {
-    sal_uInt16 nActPage;
-
-    if ( mnCurrentPageId == 0 || mnCurrentPageId == USHRT_MAX )
-        nActPage = maPageList.front()->nId;
-    else
-        nActPage = mnCurrentPageId;
-
-    // configuration existing?
-    //SvtViewOptions aTabDlgOpt( E_TABDIALOG, rId );
-
-    /*if ( aTabDlgOpt.Exists() )
-    {
-        // possibly position from config
-        SetWindowState(OUStringToOString(aTabDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US));
-
-        // initial TabPage from program/help/config
-        nActPage = (sal_uInt16)aTabDlgOpt.GetPageID();
-
-        if ( USHRT_MAX != mnCurrentPageId )
-            nActPage = mnCurrentPageId;
-
-        if ( GetPageData ( nActPage ) == NULL )
-            nActPage = maPageList.front()->nId;
-    }*/
-    //else if ( USHRT_MAX != mnCurrentPageId && GetPageData ( mnCurrentPageId ) != NULL )
-    nActPage = mnCurrentPageId;
-
-    mnCurrentPageId = nActPage;
-
     FocusOnIcon( mnCurrentPageId );
-
     ActivatePageImpl();
 }
 
-
-
 const SfxItemSet* IconChoiceDialog::GetRefreshedSet()
 {
     SAL_WARN( "cui.dialogs", "GetRefreshedSet not implemented" );
commit 7aa8b5bb22df7cd09eef23f4b0d40852e8bcdd50
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:54:10 2014 +0100

    coverity#1242785 Uninitialized pointer field
    
    Change-Id: Ic97bd7c3fa2f192113d702f9338cb3eaeae6109c

diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index cf945d6..931038b 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -57,6 +57,7 @@ SvxLineDefTabPage::SvxLineDefTabPage
               , "cui/ui/linestyletabpage.ui"
               , &rInAttrs ),
     rOutAttrs       ( rInAttrs ),
+    bObjSelected    ( false ),
 
     pXPool              ( (XOutdevItemPool*) rInAttrs.GetPool() ),
     aXLStyle            ( XLINE_DASH ),
@@ -64,7 +65,11 @@ SvxLineDefTabPage::SvxLineDefTabPage
     aXDash              ( OUString(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ),
     aXColor             ( OUString(), COL_BLACK ),
     aXLineAttr          ( pXPool ),
-    rXLSet              ( aXLineAttr.GetItemSet() )
+    rXLSet              ( aXLineAttr.GetItemSet() ),
+    pnDashListState(0),
+    pPageType(0),
+    nDlgType(0),
+    pPosDashLb(0)
 {
 
    get(m_pLbLineStyles   ,"LB_LINESTYLES");
@@ -146,9 +151,6 @@ SvxLineDefTabPage::SvxLineDefTabPage
     pDashList = NULL;
 }
 
-
-
-
 void SvxLineDefTabPage::Construct()
 {
     // Line style fill; do *not* add default fields here
commit d82057a3c7deba1d3a3dc65ef845ac14da7b6ba0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:50:03 2014 +0100

    coverity#1242800 Result is not floating-point
    
    Change-Id: Idcd1b3bd542512707b722708e4b3336c71fbff80

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index bcd25ff..3f23530 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1006,8 +1006,8 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt )
     double  fCos = cos( (double)mnAngle * F_PI18000 );
     double  fSin = sin( (double)mnAngle * F_PI18000 );
 
-    double  fWidthHalf = maRect.GetWidth() / 2;
-    double  fHeightHalf = maRect.GetHeight() / 2;
+    double  fWidthHalf = maRect.GetWidth() / 2.0;
+    double  fHeightHalf = maRect.GetHeight() / 2.0;
 
     double  fXDiff = fCos * fWidthHalf + fSin * (-fHeightHalf);
     double  fYDiff = - ( fSin * fWidthHalf - fCos * ( -fHeightHalf ) );
commit b22c04afb38ce4304da272cc239b9264e10e2e12
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:47:32 2014 +0100

    coverity#1242814 Result is not floating
    
    Change-Id: I56f9c9d995880bf328f021930b3fcfcb69f7a4c9

diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 1924a10..1a9fad3 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -745,7 +745,7 @@ void E3dObject::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
     // take no part in the rotation of the scene. To ensure this, there is the
     // SetGlueReallyAbsolute(sal_True);
 
-    double fWinkelInRad = nWink/100 * F_PI180;
+    double fWinkelInRad = nWink/100.0 * F_PI180;
 
     basegfx::B3DHomMatrix aRotateZ;
     aRotateZ.rotate(0.0, 0.0, fWinkelInRad);
commit 43ab43803612551cd7c2571fe1dfbbdebdaaab7c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:46:12 2014 +0100

    coverity#1242815 Result is not floating-point
    
    Change-Id: Ie50e89862ba4168c05cde385158bf82cf7aede62

diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 3978fad..580610f 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -637,7 +637,7 @@ void E3dScene::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
     // through the enter of aOutRect's (Steiner's theorem), so RotateZ
 
     RotateScene (rRef, nWink, sn, cs);  // Rotates the scene
-    double fWinkelInRad = nWink/100 * F_PI180;
+    double fWinkelInRad = nWink/100.0 * F_PI180;
 
     basegfx::B3DHomMatrix aRotation;
     aRotation.rotate(0.0, 0.0, fWinkelInRad);
commit 78bd404c8d7126f1eb0c570fcf1cce403e1a08c1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:43:27 2014 +0100

    coverity#1242826 Uninitialized pointer field
    
    Change-Id: I6292d16d8925aa8562942a016bb02ba3785196a3

diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 5da506f..311bb5d 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -95,6 +95,7 @@ SvxLineTabPage::SvxLineTabPage
     bSymbols(false),
 
     rOutAttrs           ( rInAttrs ),
+    eRP( RP_LT ),
     bObjSelected( false ),
 
     pXPool              ( (XOutdevItemPool*) rInAttrs.GetPool() ),
@@ -107,7 +108,11 @@ SvxLineTabPage::SvxLineTabPage
      pnLineEndListState( 0 ),
     pnDashListState( 0 ),
     pnColorListState( 0 ),
-   nPageType           ( 0 )
+    nPageType           ( 0 ),
+
+    nDlgType(0),
+    pPosDashLb(NULL),
+    pPosLineEndLb(NULL)
 {
     get(m_pLbLineStyle,"LB_LINE_STYLE");
     get(m_pBoxColor,"boxCOLOR");
commit 707a44089afa5fa62321a24daff6473c499a441c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:39:42 2014 +0100

    coverity#1242827 Uninitialized pointer field
    
    Change-Id: I029a1fba2a204b9b2b7482258685ab404b06bef8

diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index ce4e923..0d5801d 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -90,6 +90,7 @@ static bool cmpSelectionItems (const ThumbnailViewItem *pItem1, const ThumbnailV
 BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
     Window( i_pParent ),
     mxDesktop( Desktop::create(comphelper::getProcessComponentContext()) ),
+    mbIsSaveMode( false ),
     mbInitControls( false ),
     mnHideExternalLinks( 0 ),
     mpAccExec( NULL ),
@@ -144,6 +145,7 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
 
     get(mpAllRecentThumbnails, "all_recent");
     get(mpLocalView, "local_view");
+    mpCurrentView = mpLocalView;
 
     maDndWindows.push_back(mpAllRecentThumbnails);
 
commit 3a1132d541ebc16777d5b1e02eda50fc19930190
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:36:21 2014 +0100

    coverity#1242829 Uninitialized pointer field
    
    Change-Id: I902d5ed03979264b9d228f91a4a50b912a1eade5

diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index b6b9280..b0e5571 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -62,6 +62,7 @@ SvxBitmapTabPage::SvxBitmapTabPage(  vcl::Window* pParent, const SfxItemSet& rIn
     pnColorListState    ( 0 ),
     pPageType           ( 0 ),
     nDlgType            ( 0 ),
+    pPos                ( 0 ),
     pbAreaTP            ( 0 ),
 
     bBmpChanged         ( false ),
commit f05cc18dda02b1b87ea4d87add13d94eb608b5d7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:34:45 2014 +0100

    coverity#1242832 Result is not floating-point
    
    Change-Id: Ic244ebaf7e19f82a086318a91024767a2044ab03

diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index 8c5abaf..cd3fb81 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -140,7 +140,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
             if( rExplicitSymbol >>= aSymbol )
             {
                 drawing::Direction3D aSymbolSize( nSize, nSize, 0 );
-                drawing::Position3D aPos( rEntryKeyAspectRatio.Width/2, rEntryKeyAspectRatio.Height/2, 0 );
+                drawing::Position3D aPos( rEntryKeyAspectRatio.Width/2.0, rEntryKeyAspectRatio.Height/2.0, 0 );
                 AbstractShapeFactory* pFactory = AbstractShapeFactory::getOrCreateShapeFactory( xShapeFactory );
                 if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
                 {
commit fba7c60298fef64e0f22d7999dc979e3afdaa6a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:33:54 2014 +0100

    coverity#1242840 Unused value
    
    Change-Id: Ic702d371998d5d6b49f1c27fe80b3651e8135993

diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index 5726c9e..797a6da 100644
--- a/vcl/source/filter/sgvtext.cxx
+++ b/vcl/source/filter/sgvtext.cxx
@@ -763,9 +763,7 @@ void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType&
 
         (*R)=(*WErec); nChars=WEnChar;
 
-        if (UmbWdt>=R->ChrXP) {
-            BoxRest=UmbWdt-R->ChrXP;
-        } else {                                       // crush together
+        if (UmbWdt<R->ChrXP) {
             BoxRest=R->ChrXP-UmbWdt;                   // so much should be crushed
             for (i=2;i<=nChars;i++) {                  // first character position remains!
                 Line[i]-=(i-1)*(BoxRest) /(nChars-1);
commit 05a47ac4a577088ff642a3f0909c523d25225efb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:32:19 2014 +0100

    coverity#1242841 Unused value
    
    Change-Id: I80e92af60fb1a5f6c761d9211e07566618cf9668

diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 65c25cc..319e1ae 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1196,7 +1196,6 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
             aOldSelection = pOLV->GetSelection();
             if (!pOLV->GetEditView().HasSelection())
             {
-                bRestoreSelection   = true;
                 pOLV->GetEditView().SelectCurrentWord();
             }
 
commit 9fcee377828407a6c97bf4db45861537ab433544
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:31:29 2014 +0100

    coverity#1242843 Unused value
    
    Change-Id: Ib7d87cfb4647b0495a122a4d63578afb5d54a965

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index c75880a..a5cef0d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1077,8 +1077,8 @@ bool SfxObjectShell::DoSave()
 #endif
         }
 
-        if ( bOk )
-            bOk = Save();
+        if (bOk)
+            Save();
 
         bOk = pMedium->Commit();
     }
commit e16991f032e1f8cef0c7d4e3731cdd998efb11da
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:30:09 2014 +0100

    coverity#1242857 Unused value
    
    Change-Id: I015952c56ea686f307b0b5ccaad29ace9ebfa301

diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 9ea3800..2fd824c 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -155,7 +155,6 @@ bool SfxFrame::DoClose()
 
 bool SfxFrame::DoClose_Impl()
 {
-    bool bRet = true;
     SfxBindings* pBindings = NULL;
     if ( pImp->pCurrentViewFrame )
         pBindings = &pImp->pCurrentViewFrame->GetBindings();
@@ -165,12 +164,12 @@ bool SfxFrame::DoClose_Impl()
         pImp->pWorkWin->DeleteControllers_Impl();
 
     if ( pImp->pCurrentViewFrame )
-        bRet = pImp->pCurrentViewFrame->Close();
+        pImp->pCurrentViewFrame->Close();
 
     if ( pImp->bOwnsBindings )
         DELETEZ( pBindings );
 
-    bRet = Close();
+    bool bRet = Close();
     DBG_ASSERT( bRet, "Impossible state: frame closes, but controller refuses!");
     return bRet;
 }
commit 5cb059e28b652e524534c418b85f4575a42095b3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:28:51 2014 +0100

    coverity#1242860 Unused value
    
    Change-Id: Ibd6d737cf117af0c2fdda7768da6a173c59bd346

diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index eb056b8..672221d 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -680,11 +680,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
                 bSynchronousRead = false;
                 nStatus = p_set_io_mode( maHandle, SANE_TRUE );
                 CheckConsistency( "sane_set_io_mode" );
-#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
-                if( nStatus != SANE_STATUS_GOOD )
-                    // what ?!?
-                    fprintf( stderr, "Sane::Start: driver is confused\n" );
-#endif
+                SAL_WARN_IF(nStatus != SANE_STATUS_GOOD, "extensions.scanner", "driver is confused" );
             }
 
             SANE_Int nLen=0;
commit e62fae1741545d0ff918dd15bba89fdf0c085436
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:27:02 2014 +0100

    coverity#1242864 Unused value
    
    Change-Id: I643f943b274aed8f98278d879fc0b9ad242511d3

diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index 9b3716b..16c1e9f 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -230,21 +230,18 @@ void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
 {
     tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
 
-    SwNumberTree::tSwNumTreeNumber nTmpNumber = 0;
-
     do
     {
         if (aIt == mChildren.end())
         {
             aIt = mChildren.begin();
-
-            nTmpNumber = GetStartValue();
         }
         else
             ++aIt;
 
         if (aIt != mChildren.end())
         {
+            SwNumberTree::tSwNumTreeNumber nTmpNumber = 0;
             SwNumberTreeNode * pPred = (*aIt)->GetPred();
 
             // #i64311#
commit c530841198acc74e0570e9fd9073189df1987705
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:24:54 2014 +0100

    coverity#1242872 Unused value
    
    Change-Id: If385b910c1778217d8db881b5d27ea993e27a66e

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 04d2a7b..9f7e48f 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -953,14 +953,12 @@ bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
             !mpDoc->RowHidden(rOverY, nTab) &&
             pRowInfo[nArrY].nRowNo == rOverY)
         {
-            bHOver = pRowInfo[nArrY].pCellInfo[rOverX+1].bHOverlapped;
             bVOver = pRowInfo[nArrY].pCellInfo[rOverX+1].bVOverlapped;
         }
         else
         {
             sal_uInt16 nOverlap = ((ScMergeFlagAttr*)mpDoc->GetAttr(
                                 rOverX, rOverY, nTab, ATTR_MERGE_FLAG ))->GetValue();
-            bHOver = ((nOverlap & SC_MF_HOR) != 0);
             bVOver = ((nOverlap & SC_MF_VER) != 0);
         }
     }
commit cde0a09137058ffe83b1a2e587ad1140c83507dc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:22:55 2014 +0100

    coverity#1242878 Unused value
    
    Change-Id: I123855003be3eb5ef6494cda8f42b4daeba1c272

diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx
index 8e02fa8..d0546bb 100644
--- a/comphelper/source/misc/syntaxhighlight.cxx
+++ b/comphelper/source/misc/syntaxhighlight.cxx
@@ -499,7 +499,7 @@ bool SyntaxHighlighter::Tokenizer::getNextToken( const sal_Unicode*& pos, /*out*
 
                 // Read all numbers
                 while( testCharFlags( *pos, CHAR_IN_HEX_NUMBER ) )
-                    c = *pos++;
+                    ++pos;
             }
             else
             {
commit 6b929c75bec9f928e4c97eb44d85510f0862ffe8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:20:42 2014 +0100

    coverity#1242882 Result is not floating-point
    
    Change-Id: I5072c29188e33b5711e67188441c497bf8759891

diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx
index 0c3acc3..3787d75 100644
--- a/sdext/source/presenter/PresenterHelpView.cxx
+++ b/sdext/source/presenter/PresenterHelpView.cxx
@@ -492,8 +492,8 @@ void PresenterHelpView::Resize (void)
             - mpCloseButton->GetSize().Height - gnVerticalButtonPadding;
 
         mpCloseButton->SetCenter(geometry::RealPoint2D(
-            aWindowBox.Width/2,
-            aWindowBox.Height - mpCloseButton->GetSize().Height/2));
+            aWindowBox.Width/2.0,
+            aWindowBox.Height - mpCloseButton->GetSize().Height/2.0));
 
         CheckFontSize();
     }
commit 2f2f22f91bfd4ac45a4ba6125ee06fbc5927721f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:18:30 2014 +0100

    coverity#1242896 Unused value
    
    Change-Id: Ia2690d92cfcd68f567f71a1483d13be0e7575675

diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index 7312bff..6d7d67d 100644
--- a/editeng/source/misc/txtrange.cxx
+++ b/editeng/source/misc/txtrange.cxx
@@ -528,7 +528,6 @@ void SvxBoundArgs::Concat( const tools::PolyPolygon* pPoly )
         {   // The current interval belongs between two old intervals
             if( !bSubtract )
                 pOld->insert( pOld->begin() + nRightPos, pLongArr->begin() + i - 2, pLongArr->begin() + i );
-            nIdx = nRightPos + 2;
         }
         else if( bSubtract ) // Subtract, if necessary separate
         {
commit 6a5d0b6ad52ab6a01044daa31ca3c21b6565893e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:16:57 2014 +0100

    coverity#1242903 Result is not floating-point
    
    Change-Id: Id816a9b8845eb9d41bfea5a8399bca86726bebfe

diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index d1d834f..a0b3213 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -177,9 +177,9 @@ void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 _nJulianTime,com::sun::star::u
 
     if ( _nJulianTime )
     {
-        double d_s = _nJulianTime / 1000;
-        double d_m = d_s / 60;
-        double d_h  = d_m / 60;
+        double d_s = _nJulianTime / 1000.0;
+        double d_m = d_s / 60.0;
+        double d_h  = d_m / 60.0;
         _rDateTime.Hours = (sal_uInt16) (d_h);
         _rDateTime.Minutes = (sal_uInt16) d_m;
         _rDateTime.Seconds = static_cast<sal_uInt16>(( d_m - (double) _rDateTime.Minutes ) * 60.0);
commit c7c385bb8e42d2051bcf05fd75b2146fe9852317
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:15:29 2014 +0100

    coverity#1242904 error code overwritten
    
    Change-Id: Ie5dcc39f05d7fd21a873ac95ca9cc7f00c1961df

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 9975213..e6fcb91 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1884,7 +1884,8 @@ void SAL_CALL SfxBaseModel::load(   const Sequence< beans::PropertyValue >& seqA
                     m_pData->m_pObjectShell->PrepareSecondTryLoad_Impl();
                     if ( !m_pData->m_pObjectShell->DoLoad(pMedium) )
                         nError=ERRCODE_IO_GENERAL;
-                    nError = m_pData->m_pObjectShell->GetErrorCode();
+                    if (m_pData->m_pObjectShell->GetErrorCode())
+                        nError = m_pData->m_pObjectShell->GetErrorCode();
                 }
             }
 
commit a165aa38d9009bf46e203bbdfbac3b7cd8f71b4c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:12:30 2014 +0100

    coverity#1242906 Unused value
    
    Change-Id: I7a282e5adc60e4b123469f46fb480805377626b4

diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 3383f4c..6007a35 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -681,7 +681,7 @@ void SdPublishingDlg::GetParameterSequence( Sequence< PropertyValue >& rParams )
     HtmlPublishMode ePublishMode;
     if (pPage2_Frames->IsChecked())
         ePublishMode = PUBLISH_FRAMES;
-    if (pPage2_SingleDocument->IsChecked())
+    else if (pPage2_SingleDocument->IsChecked())
         ePublishMode = PUBLISH_SINGLE_DOCUMENT;
     else if (pPage2_Kiosk->IsChecked())
         ePublishMode  = PUBLISH_KIOSK;
commit 62f2b370e5ba4e8a70486d4bc9fa3871575ef192
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 10:11:32 2014 +0100

    coverity#1242905 Uninitialized pointer field
    
    Change-Id: Idbc3c594c5ae6949beaa0b8dcfd8d56f54902f9f

diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index b2340be..bc1642d 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -154,6 +154,21 @@ FloatingWindow::FloatingWindow( vcl::Window* pParent, WinBits nStyle ) :
 
 FloatingWindow::FloatingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame)
     : SystemWindow(WINDOW_FLOATINGWINDOW)
+    , mpNextFloat(0)
+    , mpFirstPopupModeWin(0)
+    , mpImplData(0)
+    , mnPostId(0)
+    , mnPopupModeFlags(0)
+    , mnTitle(0)
+    , mnOldTitle(0)
+    , mbInPopupMode(false)
+    , mbPopupMode(false)
+    , mbPopupModeCanceled(false)
+    , mbPopupModeTearOff(false)
+    , mbMouseDown(false)
+    , mbOldSaveBackMode(false)
+    , mbGrabFocus(false)
+    , mbInCleanUp(false)
 {
     loadUI(pParent, rID, rUIXMLDescription, rFrame);
 }
commit 33a3368ff513c8996c5eee38c5a64b42a1ffea30
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:51:51 2014 +0100

    coverity#1242909 Unused value and const things up
    
    Change-Id: Ib98a81a04f721917ee3c1fdd19d23a37c5d2c481

diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 19d4273..4121b72 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -833,7 +833,6 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( std::vector<OUString>& rEnt
     vcl::Font   aFont=m_pLbCategory->GetFont();
     size_t      i = 0;
     short       nTmpCatPos;
-    short       aPrivCat;
 
     m_pLbFormat->Clear();
     m_pLbFormat->SetUpdateMode( false );
@@ -860,7 +859,6 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( std::vector<OUString>& rEnt
                                     aTmpString=aEntry;
                                 else
                                     aTmpString = pNumFmtShell->GetStandardName();
-                                aPrivCat=pNumFmtShell->GetCategory4Entry(0);
                                 m_pLbFormat->InsertFontEntry( aTmpString, aFont );
                                 break;
 
@@ -872,7 +870,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( std::vector<OUString>& rEnt
         for ( ; i < rEntries.size(); ++i )
         {
             aEntry = rEntries[i];
-            aPrivCat=pNumFmtShell->GetCategory4Entry( static_cast<short>(i) );
+            short aPrivCat = pNumFmtShell->GetCategory4Entry( static_cast<short>(i) );
             if(aPrivCat!=CAT_TEXT)
             {
                 Color* pPreviewColor = NULL;
diff --git a/include/svx/numfmtsh.hxx b/include/svx/numfmtsh.hxx
index d7282d1..0c16265 100644
--- a/include/svx/numfmtsh.hxx
+++ b/include/svx/numfmtsh.hxx
@@ -155,7 +155,7 @@ public:
     OUString            GetStandardName() const;
 
     OUString            GetComment4Entry(short nEntry);
-    short               GetCategory4Entry(short nEntry);
+    short               GetCategory4Entry(short nEntry) const;
     bool                GetUserDefined4Entry(short nEntry);
     OUString            GetFormat4Entry(short nEntry);
     void                SetComment4Entry(short nEntry, const OUString& aCommentString);
@@ -217,8 +217,8 @@ private:
 
     SVX_DLLPRIVATE void  GetPreviewString_Impl( OUString& rString,
                                                 Color*& rpColor );
-    SVX_DLLPRIVATE void  PosToCategory_Impl( sal_uInt16 nPos, short& rCategory );
-    SVX_DLLPRIVATE void  CategoryToPos_Impl( short nCategory, sal_uInt16& rPos );
+    SVX_DLLPRIVATE void  PosToCategory_Impl(sal_uInt16 nPos, short& rCategory) const;
+    SVX_DLLPRIVATE void  CategoryToPos_Impl(short nCategory, sal_uInt16& rPos) const;
 };
 
 #endif
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 138d105..e8718fe 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -1149,11 +1149,8 @@ bool SvxNumberFormatShell::IsAdded_Impl( size_t nKey )
     return GetAdded_Impl( nKey ) != aAddList.end();
 }
 
-
 // Konvertierungs-Routinen:
-
-
-void SvxNumberFormatShell::PosToCategory_Impl( sal_uInt16 nPos, short& rCategory )
+void SvxNumberFormatShell::PosToCategory_Impl(sal_uInt16 nPos, short& rCategory) const
 {
     // Kategorie ::com::sun::star::form-Positionen abbilden (->Resource)
     switch ( nPos )
@@ -1173,9 +1170,7 @@ void SvxNumberFormatShell::PosToCategory_Impl( sal_uInt16 nPos, short& rCategory
     }
 }
 
-
-
-void SvxNumberFormatShell::CategoryToPos_Impl( short nCategory, sal_uInt16& rPos )
+void SvxNumberFormatShell::CategoryToPos_Impl(short nCategory, sal_uInt16& rPos) const
 {
     // Kategorie auf ::com::sun::star::form-Positionen abbilden (->Resource)
     switch ( nCategory )
@@ -1255,7 +1250,7 @@ OUString SvxNumberFormatShell::GetComment4Entry(short nEntry)
  * Input:      Nummer des Eintrags
  * Output:     Kategorie- Nummer
  */
-short SvxNumberFormatShell::GetCategory4Entry(short nEntry)
+short SvxNumberFormatShell::GetCategory4Entry(short nEntry) const
 {
     if(nEntry<0) return 0;
     if( static_cast<size_t>(nEntry) < aCurEntryList.size() )
commit 10a17fe72998a951fb4fca9da4467df84700b0a2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:48:49 2014 +0100

    coverity#1242917 Result is not floating-point
    
    Change-Id: I284562585c10a3d68b8545df7b6cb3022001660c

diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx
index 2fa608a..88638b88 100644
--- a/oox/source/drawingml/effectproperties.cxx
+++ b/oox/source/drawingml/effectproperties.cxx
@@ -48,7 +48,7 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
                 attribIt->second >>= nAttrDist;
 
             // Negative X or Y dist indicates left or up, respectively
-            double nAngle = ( nAttrDir / PER_DEGREE ) * F_PI180;
+            double nAngle = ( static_cast<double>(nAttrDir) / PER_DEGREE ) * F_PI180;
             sal_Int32 nDist = convertEmuToHmm( nAttrDist );
             sal_Int32 nXDist = cos(nAngle) * nDist;
             sal_Int32 nYDist = sin(nAngle) * nDist;
commit 01fbbf42689360bee4813a380726ea2747f550f9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:47:10 2014 +0100

    coverity#1242921 Result is not floating-point
    
    Change-Id: Iaeb1d6074fa7c9f66810cee563be0850ccc1d769

diff --git a/sfx2/source/control/templatecontaineritem.cxx b/sfx2/source/control/templatecontaineritem.cxx
index d16cb69..16e05d1 100644
--- a/sfx2/source/control/templatecontaineritem.cxx
+++ b/sfx2/source/control/templatecontaineritem.cxx
@@ -134,8 +134,8 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
                 aImageSize = pImage->GetSizePixel();
             }
 
-            float nOffX = (aThumbSize.getWidth() - aImageSize.getWidth()) / 2;
-            float nOffY = (aThumbSize.getHeight() - aImageSize.getHeight()) / 2;
+            float nOffX = (aThumbSize.getWidth() - aImageSize.getWidth()) / 2.0;
+            float nOffY = (aThumbSize.getHeight() - aImageSize.getHeight()) / 2.0;
 
             float fWidth = aImageSize.Width();
             float fHeight = aImageSize.Height();
commit 951f605aee304a37d6f7011dc4defce9ca079405
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:46:03 2014 +0100

    coverity#1242934 Result is not floating-point
    
    Change-Id: I800f978102f1d1427584cf55d3da7768e7c7f2f3

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index e7084f6..bcd25ff 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1048,7 +1048,7 @@ void PPTWriter::ImplAdjustFirstLineLineSpacing( TextObj& rTextObj, EscherPropert
                 if ( ( nLineSpacing > 0 ) && ( nLineSpacing < 100 ) )
                 {
                     double fCharHeight = rPortion.mnCharHeight;
-                    fCharHeight *= 2540 / 72;
+                    fCharHeight *= 2540 / 72.0;
                     fCharHeight *= 100 - nLineSpacing;
                     fCharHeight /= 100;
 
commit 60c0f21c81f931c8579e8902754021571d2cccbe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:44:12 2014 +0100

    coverity#1242940 Uninitialized scalar field
    
    Change-Id: I60efbf0cbba81f973a258f1ba90cc910b1abe075

diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index dcb74f2..75e5bac 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -40,7 +40,12 @@ ScInsertContentsDlg::ScInsertContentsDlg( vcl::Window*       pParent,
     bMoveDownDisabled( false ),
     bMoveRightDisabled( false ),
     bUsedShortCut   ( false ),
-    nShortCutInsContentsCmdBits( IDF_NONE )
+    nShortCutInsContentsCmdBits( IDF_NONE ),
+    nShortCutFormulaCmdBits(0),
+    bShortCutSkipEmptyCells(false),
+    bShortCutTranspose(false),
+    bShortCutIsLink(false),
+    nShortCutMoveMode(INS_NONE)
 {
     get( mpBtnInsAll, "paste_all" );
     get( mpBtnInsStrings, "text" );
commit 2d1253af62bdc0aed11dd65cfa13531a663fd343
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:42:00 2014 +0100

    coverity#1242946 Unused value
    
    Change-Id: I5a5f0e96f8dc7443901ea7de568a21924137e139

diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx
index 168b3e7..a868c9b 100644
--- a/sax/source/expatwrap/xml2utf.cxx
+++ b/sax/source/expatwrap/xml2utf.cxx
@@ -87,7 +87,6 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence<sal_Int8> &seq , sal_In
                     // initialize decoding
                     initializeDecoding();
                 }
-                nRead = seq.getLength();
                 seqStart = Sequence < sal_Int8 > ();
             }
 
commit f8fadd52baa35221031f545481e127860907a0f8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:36:45 2014 +0100

    coverity#1242948 Result is not floating-point
    
    Change-Id: I6ca09e2c9b40c49541ad13b5ba588a625ee454fb

diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index bc043ed..caad92d 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -799,10 +799,10 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef,
             }
             if ( aFrmSz.GetWidthPercent() && aFrmSz.GetWidthPercent() != 0xFF &&
                  aOldFrmSz.GetWidth() != aFrmSz.GetWidth() )
-                aFrmSz.SetWidthPercent( sal_uInt8(aSz.Width() * 100L / nRelWidth + 0.5) );
+                aFrmSz.SetWidthPercent( sal_uInt8(aSz.Width() * 100.0 / nRelWidth + 0.5) );
             if ( aFrmSz.GetHeightPercent() && aFrmSz.GetHeightPercent() != 0xFF &&
                  aOldFrmSz.GetHeight() != aFrmSz.GetHeight() )
-                aFrmSz.SetHeightPercent( sal_uInt8(aSz.Height() * 100L / nRelHeight + 0.5) );
+                aFrmSz.SetHeightPercent( sal_uInt8(aSz.Height() * 100.0 / nRelHeight + 0.5) );
             pFmt->GetDoc()->SetAttr( aFrmSz, *pFmt );
         }
     }
commit db5ed50ceeea8dad6f7603e935be30e2c585cf7d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:33:07 2014 +0100

    coverity#1242961 Unused value
    
    I'm guessing that this is what was meant. Though
    hstr2ksstr and kstr2hstr still don't match, and I'm assuming
    they are supposed to be mirror images of each other.
    
    Change-Id: I0fccd086e16c043324af43a5c999c2fde7cf7505

diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx
index 92ca0e3..93f5f0f 100644
--- a/hwpfilter/source/hcode.cxx
+++ b/hwpfilter/source/hcode.cxx
@@ -1188,15 +1188,15 @@ hchar_string hstr2ucsstr(hchar const* hstr)
 {
     ::std::string ret;
     int res, j;
-    int c;
      hchar dest[3];
     for( ; *hstr ; )
     {
         res = hcharconv(*hstr++, dest, KS);
           for( j = 0 ; j < res ; j++ ){
-              c = dest[j];
-              if( c < 32 ) c = ' ';
-              else if( c < 256 )
+              int c = dest[j];
+              if( c < 32 )
+                  c = ' ';
+              if( c < 256 )
               {
                   ret.push_back(sal::static_int_cast<char>(c));
               }
commit 83766aa698c3a8bfaa04f78c22f54213fc47b3cb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:26:37 2014 +0100

    coverity#1242965 Result is not floating-point
    
    Change-Id: If190c21cdc0647c18c7c7ba561e677dc26d0d4b5

diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index 0d7cdc0..fe2f0d5 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -833,7 +833,7 @@ Bool2Shadow( const uno::Any& rAny )
 static gchar *
 Short2Degree( const uno::Any& rAny )
 {
-    float f = rAny.get<sal_Int16>() / 10;
+    float f = rAny.get<sal_Int16>() / 10.0;
     return g_strdup_printf( "%g", f );
 }
 
commit 2b08019e2a5aa2cb097099370c8d02a9ae1c75ee
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 2 09:23:35 2014 +0100

    coverity#1242970 Result is not floating-point
    
    Change-Id: Icd0b04a2b8d9250418dfec95668fa6c496e45e5e

diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 3ef8ec5..1c3dd05 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -2822,9 +2822,9 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
                     sal_Int32 nOffsetX( 0 );
                     sal_Int32 nOffsetY( 0 );
                     if ( bHorizontalDockArea )
-                        nOffsetY = sal_Int32( floor( aRowColumnRect.getHeight() / 2 + 0.5 ));
+                        nOffsetY = sal_Int32( floor( aRowColumnRect.getHeight() / 2.0 + 0.5 ));
                     else
-                        nOffsetX = sal_Int32( floor( aRowColumnRect.getWidth() / 2 + 0.5 ));
+                        nOffsetX = sal_Int32( floor( aRowColumnRect.getWidth() / 2.0 + 0.5 ));
 
                     if ( rDockingOperation == DOCKOP_BEFORE_COLROW )
                     {


More information about the Libreoffice-commits mailing list