[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - filter/source sw/inc sw/source

Armin Le Grand alg at apache.org
Tue Oct 7 07:07:49 PDT 2014


 filter/source/msfilter/msdffimp.cxx |   18 ++++++++++++------
 sw/inc/tgrditem.hxx                 |    9 ++++++++-
 sw/source/core/layout/atrfrm.cxx    |   16 ++++++++++++----
 3 files changed, 32 insertions(+), 11 deletions(-)

New commits:
commit 09ab75fa36e15ce7de24900d374a6f481f7bfce2
Author: Armin Le Grand <alg at apache.org>
Date:   Tue Oct 7 13:40:29 2014 +0000

    i125476 Reverted i125187 but kept comments for the case someone else is about to do the same fix

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 209bddf..3377b64 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6054,7 +6054,7 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe
             nLenFBSE = nLength;
             // ist FBSE gross genug fuer unsere Daten
             sal_Bool bOk = ( nSkipBLIPLen + 4 + nSkipBLIPPos + 4 <= nLenFBSE );
-            bool bBLIPIsDirectlyEmbedded(false);
+            // #125476# bool bBLIPIsDirectlyEmbedded(false);
 
             if(bOk)
             {
@@ -6066,10 +6066,11 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe
                 // stream, else 1. Use this as hint to be more reliable (see below)
                 rSt >> nBLIPPos;
 
-                if(0 == nBLIPPos)
-                {
-                    bBLIPIsDirectlyEmbedded = true;
-                }
+                // #125476# Taking back this change - see issue. It probably was a wrong assumtion
+                // if(0 == nBLIPPos)
+                // {
+                //     bBLIPIsDirectlyEmbedded = true;
+                // }
 
                 rSt >> nBLIPPos;
                 bOk = rSt.GetError() == 0;
@@ -6089,7 +6090,12 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe
                 // This modification works with all ppt files I found which use directly embedded
                 // BLIPs and with the file which showed the error. More work may be needed when
                 // exceptions to this more strict schema may show up, though.
-                if(0 == nBLIPPos && nBLIPLen < nLenFBSE && bBLIPIsDirectlyEmbedded)
+                //
+                // #125476# back to original - see task. Keeping the change in the code as hint
+                // if this comes up again for someone who tries to fix it. This would show that
+                // indeed the information that the blip is embedded needs to be extracted somwhere
+                // and would need to be re-evaluated.
+                if(0 == nBLIPPos && nBLIPLen < nLenFBSE ) // #125476# && bBLIPIsDirectlyEmbedded)
                 {
                     // get BLIP file position as directly following embedded
                     nBLIPPos = rSt.Tell() + 4;
commit 9915e6150d6f5e01cf7191304758e21d635fbcbf
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Tue Oct 7 13:08:12 2014 +0000

    125549: accept only positive values for SwTextGridItem::nBaseWidth
    
    kudos to Mark Hung for defect finding and analysis

diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx
index 34f6fe4..306b907 100644
--- a/sw/inc/tgrditem.hxx
+++ b/sw/inc/tgrditem.hxx
@@ -93,7 +93,14 @@ public:
 
     //for textgrid enhancement
     sal_uInt16 GetBaseWidth() const { return nBaseWidth;}
-    void SetBaseWidth( sal_uInt16 nNew ) { nBaseWidth = nNew; }
+    void SetBaseWidth( sal_uInt16 nNew )
+    {
+        // only accept positive values
+        if ( nBaseWidth > 0 )
+        {
+            nBaseWidth = nNew;
+        }
+    }
 
     sal_Bool IsSnapToChars() const { return bSnapToChars; }
     sal_Bool GetSnapToChars() const { return bSnapToChars; }
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index d862713..098347f 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2185,10 +2185,18 @@ sal_Bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
  *************************************************************************/
 
 SwTextGridItem::SwTextGridItem()
-    : SfxPoolItem( RES_TEXTGRID ), aColor( COL_LIGHTGRAY ), nLines( 20 ),
-      nBaseHeight( 400 ), nRubyHeight( 200 ), eGridType( GRID_NONE ),
-      bRubyTextBelow( 0 ), bPrintGrid( 1 ), bDisplayGrid( 1 ),
-      nBaseWidth(400), bSnapToChars( 1 ), bSquaredMode(1)
+    : SfxPoolItem( RES_TEXTGRID )
+    , aColor( COL_LIGHTGRAY )
+    , nLines( 20 )
+    , nBaseHeight( 400 )
+    , nRubyHeight( 200 )
+    , eGridType( GRID_NONE )
+    , bRubyTextBelow( 0 )
+    , bPrintGrid( 1 )
+    , bDisplayGrid( 1 )
+    , nBaseWidth( 400 )
+    , bSnapToChars( 1 )
+    , bSquaredMode( 1 )
 {
 }
 


More information about the Libreoffice-commits mailing list