[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 7 commits - basctl/source filter/source i18npool/qa i18npool/source include/unotools sd/source sw/source unotools/source vcl/source

Michael Stahl mstahl at redhat.com
Wed Mar 29 12:30:39 UTC 2017


 basctl/source/basicide/scriptdocument.cxx           |   10 ++++
 filter/source/msfilter/msdffimp.cxx                 |   48 ++++++++++----------
 i18npool/qa/cppunit/test_breakiterator.cxx          |    4 +
 i18npool/source/breakiterator/breakiteratorImpl.cxx |    3 -
 include/unotools/eventcfg.hxx                       |    2 
 sd/source/ui/dlg/navigatr.cxx                       |    3 +
 sw/source/core/doc/doctxm.cxx                       |   42 +++++++++++------
 unotools/source/config/eventcfg.cxx                 |    2 
 vcl/source/window/window.cxx                        |   25 +++++-----
 9 files changed, 87 insertions(+), 52 deletions(-)

New commits:
commit 0a483513f198d2e4bbeb2368d5f0763721f9a062
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Mar 21 11:01:20 2017 +0100

    tdf#106377 sw: fix Undo of delete of ToXMark from dialog
    
    The problem is that SwUndoResetAttr and the SwHistorySetTOXMark by
    design only insert the SwTextAttr, they don't insert the dummy char of
    a SwTextAttr that needs one, like the ToXMark does if it marks a point.
    
    So just change SwDoc::DeleteTOXMark to create SwUndoDelete instead.
    
    Change-Id: Ic1eebac4cf859771a6032bffb2fd8e198aa08084
    (cherry picked from commit 63f7da77985674ddf59bb566bdada9c41893e822)
    Reviewed-on: https://gerrit.libreoffice.org/35501
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 123bb36e7eafde85732b57e84d0377586a0a66d8)

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index b3462b761a41..46496a78d662 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -154,26 +154,38 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
     SwTextNode& rTextNd = const_cast<SwTextNode&>(pTextTOXMark->GetTextNode());
     OSL_ENSURE( rTextNd.GetpSwpHints(), "cannot be deleted" );
 
-    std::unique_ptr<SwRegHistory> aRHst;
-    if (GetIDocumentUndoRedo().DoesUndo())
+    if (pTextTOXMark->HasDummyChar())
     {
-        // save attributes for Undo
-        SwUndoResetAttr* pUndo = new SwUndoResetAttr(
-            SwPosition( rTextNd, SwIndex( &rTextNd, pTextTOXMark->GetStart() ) ),
-            RES_TXTATR_TOXMARK );
-        GetIDocumentUndoRedo().AppendUndo( pUndo );
-
-        aRHst.reset(new SwRegHistory(rTextNd, &pUndo->GetHistory()));
-        rTextNd.GetpSwpHints()->Register(aRHst.get());
+        // tdf#106377 don't use SwUndoResetAttr, it uses NOTXTATRCHR
+        SwPaM tmp(rTextNd, pTextTOXMark->GetStart(),
+                  rTextNd, pTextTOXMark->GetStart()+1);
+        assert(rTextNd.GetText()[pTextTOXMark->GetStart()] == CH_TXTATR_INWORD);
+        getIDocumentContentOperations().DeleteRange(tmp);
     }
+    else
+    {
+        std::unique_ptr<SwRegHistory> aRHst;
+        if (GetIDocumentUndoRedo().DoesUndo())
+        {
+            // save attributes for Undo
+            SwUndoResetAttr* pUndo = new SwUndoResetAttr(
+                SwPosition( rTextNd, SwIndex( &rTextNd, pTextTOXMark->GetStart() ) ),
+                RES_TXTATR_TOXMARK );
+            GetIDocumentUndoRedo().AppendUndo( pUndo );
+
+            aRHst.reset(new SwRegHistory(rTextNd, &pUndo->GetHistory()));
+            rTextNd.GetpSwpHints()->Register(aRHst.get());
+        }
 
-    rTextNd.DeleteAttribute( const_cast<SwTextTOXMark*>(pTextTOXMark) );
+        rTextNd.DeleteAttribute( const_cast<SwTextTOXMark*>(pTextTOXMark) );
 
-    if (GetIDocumentUndoRedo().DoesUndo())
-    {
-        if( rTextNd.GetpSwpHints() )
-            rTextNd.GetpSwpHints()->DeRegister();
+        if (GetIDocumentUndoRedo().DoesUndo())
+        {
+            if( rTextNd.GetpSwpHints() )
+                rTextNd.GetpSwpHints()->DeRegister();
+        }
     }
+
     getIDocumentState().SetModified();
 }
 
commit adcb19b32076b69e0abfb0b79db6263f59839dac
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Tue Mar 28 19:58:25 2017 +0200

    tdf#106755: Fix script type for combining marks
    
    We are classifying characters in the “Combining Diacritical Marks”
    Unicode block with ScriptType::LATIN, but these are combining marks and
    can combine with any script and should have been ScriptType::WEAK. Just
    removing them from the range in scriptList does the trick as we will
    fallback to getting the script classification based on the Unicode
    script property.
    
    Change-Id: I3577f4b03360a1c8e094a207f01b6bbb6abbaf30
    Reviewed-on: https://gerrit.libreoffice.org/35811
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 55ddbfc610d2a00e565ca7bcb0277da33bb90947)
    Reviewed-on: https://gerrit.libreoffice.org/35815
    (cherry picked from commit 1c5d8ea51f9da89d76b2b2d3bb896225a6ac9dca)

diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index c00c716efac2..fb1a155ae9db 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -759,6 +759,10 @@ void TestBreakIterator::testWeak()
         {
             0x0001, 0x0002,
             0x0020, 0x00A0,
+            0x0300, 0x036F, //Combining Diacritical Marks
+            0x1AB0, 0x1AFF, //Combining Diacritical Marks Extended
+            0x1DC0, 0x1DFF, //Combining Diacritical Marks Supplement
+            0x20D0, 0x20FF, //Combining Diacritical Marks for Symbols
             0x2150, 0x215F, //Number Forms, fractions
             0x2160, 0x2180, //Number Forms, roman numerals
             0x2200, 0x22FF, //Mathematical Operators
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 33ac5864a79c..f8a39ff2d253 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -444,7 +444,8 @@ struct UBlock2Script
 static const UBlock2Script scriptList[] =
 {
     {UBLOCK_NO_BLOCK, UBLOCK_NO_BLOCK, ScriptType::WEAK},
-    {UBLOCK_BASIC_LATIN, UBLOCK_ARMENIAN, ScriptType::LATIN},
+    {UBLOCK_BASIC_LATIN, UBLOCK_SPACING_MODIFIER_LETTERS, ScriptType::LATIN},
+    {UBLOCK_GREEK, UBLOCK_ARMENIAN, ScriptType::LATIN},
     {UBLOCK_HEBREW, UBLOCK_MYANMAR, ScriptType::COMPLEX},
     {UBLOCK_GEORGIAN, UBLOCK_GEORGIAN, ScriptType::LATIN},
     {UBLOCK_HANGUL_JAMO, UBLOCK_HANGUL_JAMO, ScriptType::ASIAN},
commit 93df778190486ed9ddc0cb506ef1db0cd8171137
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Mar 28 10:35:50 2017 +0100

    Attempted fix for mirrored geometry crasher.
    
    Only plausible cause is pWindow->GetParent() being null, while
    we have a pParent which has to be valid.
    
    http://crashreport.libreoffice.org/stats/crash_details/6161398d-17b6-4a93-aa70-a559efa07868
    
    Code was initially introduced in this form:
            commit 4716735ba7d0ad133ff018481f94d6b4f201bbd9
            Author: Stephan Schäfer <ssa at openoffice.org>
            Date:   Thu Sep 19 15:46:19 2002 +0000
    
            #103362# improve positioning and resizing of system windows
    
    No public report, sadly.  And modified by
    
    commit fba46c6efd08d50fee92cc11546f3ed253a57af8
    Author: Chris Sherlock <chris.sherlock79 at gmail.com>
    Date:   Mon Feb 3 16:46:04 2014 +1100
    
        fdo#74424 Use Window::GetOutDev() to access ImplReMirrored()
    
        Part of the decoupling of Window from OutputDevice. We now get
        he Window's OutputDevice instance and manipulate this. Do not rely
        on the inherited function.
    
    where the GetParent()/pWindow->GetParent() problem surfaces
    
    Change-Id: Ia261028a4719525135e3fe4b00074427c1d9df6c
    Reviewed-on: https://gerrit.libreoffice.org/35796
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit d93b8268da982ad26db9e03156ce9b89f3410486)
    Reviewed-on: https://gerrit.libreoffice.org/35827
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 39a09641a1d2e1b50c831fe5ecf3dc0b0174a210)

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e483e2952b7c..50e7435eeb53 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2722,7 +2722,7 @@ void Window::setPosSizePixel( long nX, long nY,
         mpWindowImpl->mbDefSize = false;
 
     // The top BorderWindow is the window which is to be positioned
-    vcl::Window* pWindow = this;
+    VclPtr<vcl::Window> pWindow = this;
     while ( pWindow->mpWindowImpl->mpBorderWindow )
         pWindow = pWindow->mpWindowImpl->mpBorderWindow;
 
@@ -2739,7 +2739,8 @@ void Window::setPosSizePixel( long nX, long nY,
             nHeight = pWindow->mnOutHeight;
 
         sal_uInt16 nSysFlags=0;
-        vcl::Window *pParent = GetParent();
+        VclPtr<vcl::Window> pParent = GetParent();
+        VclPtr<vcl::Window> pWinParent = pWindow->GetParent();
 
         if( nFlags & PosSizeFlags::Width )
             nSysFlags |= SAL_FRAME_POSSIZE_WIDTH;
@@ -2748,9 +2749,9 @@ void Window::setPosSizePixel( long nX, long nY,
         if( nFlags & PosSizeFlags::X )
         {
             nSysFlags |= SAL_FRAME_POSSIZE_X;
-            if( pParent && (pWindow->GetStyle() & WB_SYSTEMCHILDWINDOW) )
+            if( pWinParent && (pWindow->GetStyle() & WB_SYSTEMCHILDWINDOW) )
             {
-                nX += pParent->mnOutOffX;
+                nX += pWinParent->mnOutOffX;
             }
             if( pParent && pParent->ImplIsAntiparallel() )
             {
@@ -2765,9 +2766,9 @@ void Window::setPosSizePixel( long nX, long nY,
         {
             // --- RTL ---  make sure the old right aligned position is not changed
             //              system windows will always grow to the right
-            if ( pParent )
+            if ( pWinParent )
             {
-                OutputDevice *pParentOutDev = pParent->GetOutDev();
+                OutputDevice *pParentOutDev = pWinParent->GetOutDev();
                 if( pParentOutDev->HasMirroredGraphics() )
                 {
                     long myWidth = nOldWidth;
@@ -2777,13 +2778,13 @@ void Window::setPosSizePixel( long nX, long nY,
                         myWidth = nWidth;
                     nFlags |= PosSizeFlags::X;
                     nSysFlags |= SAL_FRAME_POSSIZE_X;
-                    nX = pParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nX - mpWindowImpl->mpFrame->GetUnmirroredGeometry().nLeftDecoration +
-                        pParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nWidth - myWidth - 1 - mpWindowImpl->mpFrame->GetUnmirroredGeometry().nX;
+                    nX = pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nX - mpWindowImpl->mpFrame->GetUnmirroredGeometry().nLeftDecoration +
+                        pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nWidth - myWidth - 1 - mpWindowImpl->mpFrame->GetUnmirroredGeometry().nX;
                     if(!(nFlags & PosSizeFlags::Y))
                     {
                         nFlags |= PosSizeFlags::Y;
                         nSysFlags |= SAL_FRAME_POSSIZE_Y;
-                        nY = mpWindowImpl->mpFrame->GetUnmirroredGeometry().nY - pWindow->GetParent()->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nY -
+                        nY = mpWindowImpl->mpFrame->GetUnmirroredGeometry().nY - pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nY -
                             mpWindowImpl->mpFrame->GetUnmirroredGeometry().nTopDecoration;
                     }
                 }
@@ -2792,9 +2793,9 @@ void Window::setPosSizePixel( long nX, long nY,
         if( nFlags & PosSizeFlags::Y )
         {
             nSysFlags |= SAL_FRAME_POSSIZE_Y;
-            if( pParent && (pWindow->GetStyle() & WB_SYSTEMCHILDWINDOW) )
+            if( pWinParent && (pWindow->GetStyle() & WB_SYSTEMCHILDWINDOW) )
             {
-                nY += pParent->mnOutOffY;
+                nY += pWinParent->mnOutOffY;
             }
         }
 
@@ -2803,7 +2804,7 @@ void Window::setPosSizePixel( long nX, long nY,
             // check for min/max client size and adjust size accordingly
             // otherwise it may happen that the resize event is ignored, i.e. the old size remains
             // unchanged but ImplHandleResize() is called with the wrong size
-            SystemWindow *pSystemWindow = dynamic_cast< SystemWindow* >( pWindow );
+            SystemWindow *pSystemWindow = dynamic_cast< SystemWindow* >( pWindow.get() );
             if( pSystemWindow )
             {
                 Size aMinSize = pSystemWindow->GetMinOutputSizePixel();
commit 3bec59079aec39a94867a326739cb877805af6f7
Author: Jean-Baptiste Faure <jbfaure at libreoffice.org>
Date:   Mon Mar 27 22:08:26 2017 +0200

    tdf#105843 : restore Application Start and Stop events
    
    Change-Id: Ifc99fcf84182edb49cac741f7bb10a1b239d5703
    Reviewed-on: https://gerrit.libreoffice.org/35779
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 7c0054f1b7c3c475bff7a5adfdea0feaecf20748)
    Reviewed-on: https://gerrit.libreoffice.org/35812
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 98399c291239e309769fe9a1099655343b21ccd2)

diff --git a/include/unotools/eventcfg.hxx b/include/unotools/eventcfg.hxx
index 03ccdd4181d2..51f54ccd4dda 100644
--- a/include/unotools/eventcfg.hxx
+++ b/include/unotools/eventcfg.hxx
@@ -31,6 +31,8 @@
 
 enum class GlobalEventId
 {
+    STARTAPP,
+    CLOSEAPP,
     DOCCREATED,
     CREATEDOC,
     LOADFINISHED,
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index f9e846ea2bf6..fe14059ab05f 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -46,6 +46,8 @@ using namespace ::com::sun::star;
 
 static o3tl::enumarray<GlobalEventId, const char*> pEventAsciiNames =
 {
+"OnStartApp",
+"OnCloseApp",
 "OnCreate",
 "OnNew",
 "OnLoadFinished",
commit 94f8eaad9cc8aa0325257a529a26559a1f911a6b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 20 11:50:57 2017 +0000

    Resolves: tdf#106612 fix double click in draw/impress navigator
    
    Change-Id: Ic4b08c6e5cd430b5278bdc2cb7f1205bba160740
    (cherry picked from commit 879aa0f71d98969f6bf2e540f1e95c7c9e0e05bf)
    Reviewed-on: https://gerrit.libreoffice.org/35539
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 9fd212c3fbc28868e15f5d8e8ae598ac34176991)

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 084fdaf2fc03..d689036e3072 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -82,6 +82,9 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings)
 
     maTlbObjects->SetAccessibleName(SD_RESSTR(STR_OBJECTS_TREE));
 
+    maTlbObjects->SetDoubleClickHdl(LINK(this, SdNavigatorWin, ClickObjectHdl));
+    maTlbObjects->SetSelectionMode(SelectionMode::Single);
+
     maToolbox->SetSelectHdl( LINK( this, SdNavigatorWin, SelectToolboxHdl ) );
     maToolbox->SetDropdownClickHdl( LINK(this, SdNavigatorWin, DropdownClickToolBoxHdl) );
     const sal_uInt16 nDragTypeId = maToolbox->GetItemId("dragmode");
commit 8a622164d80c780863b09f01d16f4e5c919b869c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 4 23:58:13 2017 +0100

    tdf#105069, store the VBA module info for new modules as well
    
    This was never a problem until we started to export the VBA stream
    instead of just writing back the imported stream.
    
    Change-Id: I4e20e717bebd3dc649efcf1b9c18b6e5053303d9
    Reviewed-on: https://gerrit.libreoffice.org/32741
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 2be139d76bdb66e77719613d802dc0047c284456)
    Reviewed-on: https://gerrit.libreoffice.org/35198
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit fd242f02b195f896b23336fe51773d7abf310d4e)

diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index a99fefafe8a3..135ea2b9659b 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -34,6 +34,8 @@
 #include <com/sun/star/document/XEmbeddedScripts.hpp>
 #include <com/sun/star/script/vba/XVBACompatibility.hpp>
 #include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
 
 #include <sfx2/objsh.hxx>
 #include <sfx2/bindings.hxx>
@@ -669,6 +671,14 @@ namespace basctl
             if ( _bCreateMain )
                 _out_rNewModuleCode += "Sub Main\n\nEnd Sub\n" ;
 
+            Reference< XVBAModuleInfo > xVBAModuleInfo(xLib, UNO_QUERY);
+            if (xVBAModuleInfo.is())
+            {
+                css::script::ModuleInfo aModuleInfo;
+                aModuleInfo.ModuleType = css::script::ModuleType::NORMAL;
+                xVBAModuleInfo->insertModuleInfo(_rModName, aModuleInfo);
+            }
+
             // insert module into library
             xLib->insertByName( _rModName, makeAny( _out_rNewModuleCode ) );
         }
commit 25bf8661d2a3ac1e4916efd32f44a716b345f2eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 28 14:45:00 2017 +0100

    valgrind: use of uninitialized values
    
    Change-Id: I5b8c6d4d4576fd88dbffdfc710cbd9b2e9429942
    (cherry picked from commit b7152aff51665bc802af66e6e599a89e0344c92f)
    Reviewed-on: https://gerrit.libreoffice.org/35805
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 8337a9b186abc5a3393127227ec727f019f09dc5)

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 1ac086b988db..81d9ae86c8bf 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1941,9 +1941,8 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
             for ( sal_uInt16 i = 0; i < nNumElem; i++ )
             {
                 PropVec aHandlePropVec;
-                sal_uInt32  nFlagsTmp;
-                SvxMSDffHandleFlags nFlags;
-                sal_Int32   nPositionX, nPositionY, nCenterX, nCenterY, nRangeXMin, nRangeXMax, nRangeYMin, nRangeYMax;
+                sal_uInt32 nFlagsTmp(0);
+                sal_Int32  nPositionX(0), nPositionY(0), nCenterX(0), nCenterY(0), nRangeXMin(0), nRangeXMax(0), nRangeYMin(0), nRangeYMax(0);
                 rIn.ReadUInt32( nFlagsTmp )
                    .ReadInt32( nPositionX )
                    .ReadInt32( nPositionY )
@@ -1953,7 +1952,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
                    .ReadInt32( nRangeXMax )
                    .ReadInt32( nRangeYMin )
                    .ReadInt32( nRangeYMax );
-                nFlags = static_cast<SvxMSDffHandleFlags>(nFlagsTmp);
+                SvxMSDffHandleFlags nFlags = static_cast<SvxMSDffHandleFlags>(nFlagsTmp);
                 if ( nPositionX == 2 )  // replacing center position with absolute value
                     nPositionX = nCoordWidth / 2;
                 if ( nPositionY == 2 )
@@ -2210,7 +2209,6 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
         {
             css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > aSegments;
 
-            sal_uInt16 i, nTmp;
             sal_uInt16 nNumElemSeg = 0;
 
             if ( SeekToContent( DFF_Prop_pSegmentInfo, rIn ) )
@@ -2227,14 +2225,13 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
             }
             if ( nNumElemSeg )
             {
-                sal_Int16 nCommand;
-                sal_Int16 nCnt;
                 aSegments.realloc( nNumElemSeg );
-                for ( i = 0; i < nNumElemSeg; i++ )
+                for (sal_uInt16 i = 0; i < nNumElemSeg; ++i)
                 {
+                    sal_uInt16 nTmp(0);
                     rIn.ReadUInt16( nTmp );
-                    nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN;
-                    nCnt = (sal_Int16)( nTmp & 0x1fff );//Last 13 bits for segment points number
+                    sal_Int16 nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN;
+                    sal_Int16 nCnt = (sal_Int16)( nTmp & 0x1fff );//Last 13 bits for segment points number
                     switch( nTmp >> 13 )//First 3 bits for command type
                     {
                         case 0x0:
@@ -3204,7 +3201,7 @@ bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, sal_u
     if ( !maFidcls.empty() )
     {
         sal_uInt32 nMerk = rSt.Tell();
-        sal_uInt32 nShapeId, nSec = ( nId >> 10 ) - 1;
+        sal_uInt32 nSec = ( nId >> 10 ) - 1;
         if ( nSec < mnIdClusters )
         {
             OffsetMap::const_iterator it = maDgOffsetTable.find( maFidcls[ nSec ].dgid );
@@ -3227,6 +3224,7 @@ bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, sal_u
                         DffRecordHeader aShapeHd;
                         if ( SeekToRec( rSt, DFF_msofbtSp, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) )
                         {
+                            sal_uInt32 nShapeId(0);
                             rSt.ReadUInt32( nShapeId );
                             if ( nId == nShapeId )
                             {
@@ -4235,7 +4233,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
     aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART );
     if ( aObjData.bChildAnchor )
     {
-        sal_Int32 l, o, r, u;
+        sal_Int32 l(0), o(0), r(0), u(0);
         rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u );
         Scale( l );
         Scale( o );
@@ -4867,14 +4865,14 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
                 {
                     if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_PPT )
                     {
-                        sal_Int32 l, t, r, b;
+                        sal_Int32 l(0), t(0), r(0), b(0);
                         if ( aShapeAtom.nRecLen == 16 )
                         {
                             rSt.ReadInt32( l ).ReadInt32( t ).ReadInt32( r ).ReadInt32( b );
                         }
                         else
                         {
-                            sal_Int16 ls, ts, rs, bs;
+                            sal_Int16 ls(0), ts(0), rs(0), bs(0);
                             rSt.ReadInt16( ts ).ReadInt16( ls ).ReadInt16( rs ).ReadInt16( bs ); // the order of coordinates is a bit strange...
                             l = ls;
                             t = ts;
@@ -4900,7 +4898,7 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
                 }
                 else if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
                 {
-                    sal_Int32 l, o, r, u;
+                    sal_Int32 l(0), o(0), r(0), u(0);
                     rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u );
                     Scale( l );
                     Scale( o );
@@ -4946,7 +4944,7 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt
                     break;
                 if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor )
                 {
-                    sal_Int32 l, o, r, u;
+                    sal_Int32 l(0), o(0), r(0), u(0);
                     rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u );
                     Scale( l );
                     Scale( o );
@@ -6063,12 +6061,13 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
             // We've found the Property Table:
             // search for the Blip Property!
             sal_uLong  nPropRead = 0;
-            sal_uInt16 nPropId;
-            sal_uInt32  nPropVal;
             nLenShapePropTbl = nLength;
             long nStartShapePropTbl = rSt.Tell();
             do
             {
+                sal_uInt16 nPropId(0);
+                sal_uInt32 nPropVal(0);
+
                 rSt.ReadUInt16( nPropId )
                    .ReadUInt32( nPropVal );
                 nPropRead += 6;
@@ -6357,7 +6356,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
                 rBLIPStream.SeekRel( nSkip + 20 );
 
                 // read in size of metafile in EMUS
-                sal_Int32 width, height;
+                sal_Int32 width(0), height(0);
                 rBLIPStream.ReadInt32( width ).ReadInt32( height );
                 aMtfSize100.Width() = width;
                 aMtfSize100.Height() = height;
@@ -6723,16 +6722,16 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen,
     if( xOle10Stm->GetError() )
         return false;
 
-    sal_uInt32 nType;
-    sal_uInt32 nRecType;
-    sal_uInt32 nStrLen;
     OUString   aSvrName;
     sal_uInt32 nDummy0;
     sal_uInt32 nDummy1;
-    sal_uInt32 nDataLen;
     sal_uInt32 nBytesRead = 0;
     do
     {
+        sal_uInt32 nType(0);
+        sal_uInt32 nRecType(0);
+        sal_uInt32 nStrLen(0);
+
         rStm.ReadUInt32( nType );
         rStm.ReadUInt32( nRecType );
         rStm.ReadUInt32( nStrLen );
@@ -6749,6 +6748,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen,
         }
         rStm.ReadUInt32( nDummy0 );
         rStm.ReadUInt32( nDummy1 );
+        sal_uInt32 nDataLen(0);
         rStm.ReadUInt32( nDataLen );
 
         nBytesRead += 6 * sizeof( sal_uInt32 ) + nStrLen + nDataLen;
@@ -7168,7 +7168,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
         }
         else if( pDataStrm )
         {
-            sal_uInt32 nLen, nDummy;
+            sal_uInt32 nLen(0), nDummy(0);
             pDataStrm->ReadUInt32( nLen ).ReadUInt32( nDummy );
             if( SVSTREAM_OK != pDataStrm->GetError() ||
                 // Id in BugDoc - exist there other Ids?


More information about the Libreoffice-commits mailing list