[Libreoffice-commits] core.git: 9 commits - editeng/source filter/source include/editeng oox/source sd/source svl/source sw/inc sw/source unusedcode.easy vcl/unx

Caolán McNamara caolanm at redhat.com
Tue Nov 11 07:22:44 PST 2014


 editeng/source/items/numitem.cxx            |   14 ++------------
 filter/source/graphicfilter/ipict/ipict.cxx |    6 ++----
 filter/source/msfilter/svdfppt.cxx          |    1 -
 include/editeng/numitem.hxx                 |    7 ++-----
 oox/source/drawingml/textrun.cxx            |   16 ++++++++++------
 sd/source/core/drawdoc4.cxx                 |    2 --
 sd/source/core/stlpool.cxx                  |    2 --
 sd/source/filter/xml/sdxmlwrp.cxx           |   15 ++++++++++++++-
 sd/source/ui/app/strings.src                |    2 +-
 sd/source/ui/view/drtxtob1.cxx              |    1 -
 svl/source/items/poolio.cxx                 |   13 +++++++++----
 sw/inc/frmfmt.hxx                           |    3 ---
 sw/source/core/doc/number.cxx               |    1 -
 sw/source/core/layout/atrfrm.cxx            |   15 ---------------
 sw/source/core/text/atrstck.cxx             |    4 ++--
 sw/source/filter/html/htmlnumreader.cxx     |    1 -
 sw/source/filter/ww8/ww8par2.cxx            |    1 -
 sw/source/uibase/shells/txtnum.cxx          |    1 -
 sw/source/uibase/wrtsh/wrtsh1.cxx           |    1 -
 unusedcode.easy                             |    6 ++++++
 vcl/unx/generic/dtrans/bmp.cxx              |   24 +++++++++++++++++-------
 21 files changed, 65 insertions(+), 71 deletions(-)

New commits:
commit 6811d2f85b49eafd0448de726d9a8287d81e7b1b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 13:33:53 2014 +0000

    strip off hard-coded numbering from outliner preview on load
    
    how to reproduce an outline which won't update wrt the numbering style
    
    file->new->presentation
    view->master->slide master
    select first entry of outliner, i.e. "Click to edit the outline text format"
    make it underlined, save, reload
    view->master->slide master
    now use bullet and numbering
    set level 1 to e.g. none, ok
    nothing happens to the outliner. It remains "stuck" with its default numbering
    
    Change-Id: I95708b1f1c9cc74ae5129dbfad8ca0d37b00fa13

diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index fd8cacc..ad1cd23 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -55,6 +55,7 @@
 #include <com/sun/star/io/XActiveDataControl.hpp>
 #include <comphelper/genericpropertyset.hxx>
 #include <comphelper/propertysetinfo.hxx>
+#include <editeng/eeitem.hxx>
 #include <unotools/saveopt.hxx>
 
 // include necessary for XML progress bar at load time
@@ -444,6 +445,7 @@ void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc)
         const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
         for (sal_Int32 j = 0; j < nParaCount; ++j)
         {
+            //Make sure the depth of the paragraph matches that of the outline style it previews
             const sal_Int16 nExpectedDepth = j;
             if (nExpectedDepth != pOutliner->GetDepth(j))
             {
@@ -451,10 +453,21 @@ void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument* pDoc)
                 pOutliner->SetDepth(p, nExpectedDepth);
                 bInconsistent = true;
             }
+
+            //If the preview has hard-coded bullets/numbering then they must
+            //be stripped to reveal the true underlying styles attributes
+            SfxItemSet aAttrs(pOutliner->GetParaAttribs(j));
+            if (aAttrs.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET)
+            {
+                aAttrs.ClearItem(EE_PARA_NUMBULLET);
+                pOutliner->SetParaAttribs(j, aAttrs);
+                bInconsistent = true;
+            }
+
         }
         if (bInconsistent)
         {
-            SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview depth");
+            SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview");
             pMasterOutline->SetOutlinerParaObject(pOutliner->CreateParaObject(0, nParaCount));
         }
         pOutliner->Clear();
commit 7efde313c2b267714604120260f680aff276dc3c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 14:10:04 2014 +0000

    have a stab at improving impossible question
    
    as to whether you want to "adapt" objects or not
    
    Change-Id: Ic4c00be480d1be632d84dfac71fe911d48eacc51

diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 2b363f6..06b0fcf 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -397,7 +397,7 @@ String STR_READ_DATA_ERROR
 };
 String STR_SCALE_OBJECTS
 {
-    Text [ en-US ] = "The format of the new pages will be adapted.\nDo you want to adapt the objects, too?" ;
+    Text [ en-US ] = "The page size of the target document is different than the source document.\n\nDo you want to scale the copied objects to fit the new page size?" ;
 };
 String STR_CREATE_PAGES
 {
commit 9bdce3517d8c6631f4265d7dde77671baebb0c4e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 13:44:51 2014 +0000

    callcatcher: dropping SwChapterNumRules binary Load/Store has knock-on effect
    
    Change-Id: I2567026af23dd5fc42812b90bd6098c4c74a4f92

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 5a6a21f..39bbf43 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -156,7 +156,6 @@ SvxNumberFormat::SvxNumberFormat( sal_Int16 eType,
       mePositionAndSpaceMode( ePositionAndSpaceMode ),
       nFirstLineOffset(0),
       nAbsLSpace(0),
-      nLSpace(0),
       nCharTextDistance(0),
       meLabelFollowedBy( LISTTAB ),
       mnListtabPos( 0 ),
@@ -182,7 +181,6 @@ SvxNumberFormat::SvxNumberFormat( SvStream &rStream )
     , nBulletRelSize(100)
     , nFirstLineOffset(0)
     , nAbsLSpace(0)
-    , nLSpace(0)
     , nCharTextDistance(0)
 {
     sal_uInt16 nTmp16(0);
@@ -197,7 +195,7 @@ SvxNumberFormat::SvxNumberFormat( SvStream &rStream )
 
     rStream.ReadInt16( nFirstLineOffset );
     rStream.ReadInt16( nAbsLSpace );
-    rStream.ReadInt16( nLSpace );
+    rStream.SeekRel(2); //skip old now unused nLSpace;
 
     rStream.ReadInt16( nCharTextDistance );
 
@@ -261,7 +259,7 @@ SvStream&   SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
 
     rStream.WriteInt16( nFirstLineOffset );
     rStream.WriteInt16( nAbsLSpace );
-    rStream.WriteInt16( nLSpace );
+    rStream.WriteInt16( 0 ); // write a dummy for old now unused nLSpace
 
     rStream.WriteInt16( nCharTextDistance );
     rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
@@ -323,7 +321,6 @@ SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
         mePositionAndSpaceMode = rFormat.mePositionAndSpaceMode;
         nFirstLineOffset    = rFormat.nFirstLineOffset;
         nAbsLSpace          = rFormat.nAbsLSpace ;
-        nLSpace             = rFormat.nLSpace ;
         nCharTextDistance   = rFormat.nCharTextDistance ;
         meLabelFollowedBy = rFormat.meLabelFollowedBy;
         mnListtabPos = rFormat.mnListtabPos;
@@ -359,7 +356,6 @@ bool  SvxNumberFormat::operator==( const SvxNumberFormat& rFormat) const
         mePositionAndSpaceMode != rFormat.mePositionAndSpaceMode ||
         nFirstLineOffset    != rFormat.nFirstLineOffset ||
         nAbsLSpace          != rFormat.nAbsLSpace ||
-        nLSpace             != rFormat.nLSpace ||
         nCharTextDistance   != rFormat.nCharTextDistance ||
         meLabelFollowedBy != rFormat.meLabelFollowedBy ||
         mnListtabPos != rFormat.mnListtabPos ||
@@ -454,10 +450,6 @@ void SvxNumberFormat::SetPositionAndSpaceMode( SvxNumPositionAndSpaceMode ePosit
     mePositionAndSpaceMode = ePositionAndSpaceMode;
 }
 
-short SvxNumberFormat::GetLSpace() const
-{
-    return mePositionAndSpaceMode == LABEL_WIDTH_AND_POSITION ? nLSpace : 0;
-}
 short SvxNumberFormat::GetAbsLSpace() const
 {
     return mePositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
@@ -604,7 +596,6 @@ SvxNumRule::SvxNumRule( sal_uLong nFeatures,
                 if ( eDefaultNumberFormatPositionAndSpaceMode ==
                                     SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
                 {
-                    aFmts[i]->SetLSpace( convertMm100ToTwip(DEF_WRITER_LSPACE) );
                     aFmts[i]->SetAbsLSpace( convertMm100ToTwip(DEF_WRITER_LSPACE * (i+1)) );
                     aFmts[i]->SetFirstLineOffset(convertMm100ToTwip(-DEF_WRITER_LSPACE));
                 }
@@ -626,7 +617,6 @@ SvxNumRule::SvxNumRule( sal_uLong nFeatures,
             }
             else
             {
-                aFmts[i]->SetLSpace( DEF_DRAW_LSPACE );
                 aFmts[i]->SetAbsLSpace( DEF_DRAW_LSPACE * (i) );
             }
         }
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index e570bba..944514f 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -6033,7 +6033,6 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet,  boost::optional< sal_Int16 >&
             {
                 if ( aNumberFormat.GetNumberingType() == SVX_NUM_NUMBER_NONE )
                 {
-                    aNumberFormat.SetLSpace( 0 );
                     aNumberFormat.SetAbsLSpace( 0 );
                     aNumberFormat.SetFirstLineOffset( 0 );
                     aNumberFormat.SetCharTextDistance( 0 );
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 3b24d56..37c9f4a 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -118,8 +118,8 @@ private:
     Color               nBulletColor;       // Bullet color
 
     // mode indicating, if the position and spacing of the list label is
-    // determined by the former attributes (nFirstLineOffset, nAbsLSpace,
-    // nLSpace and nCharTextDistance) called position and spacing via label
+    // determined by the former attributes (nFirstLineOffset, nAbsLSpace
+    // and nCharTextDistance) called position and spacing via label
     // width and position (LABEL_WIDTH_AND_POSITION) or by the new attributes
     // (meLabelFollowedBy, mnListtabPos, mnFirstLineIndent and mnIndentAt)
     // called position and spacing via label alignment.
@@ -130,7 +130,6 @@ private:
 
     short               nFirstLineOffset;   // First line indent
     short               nAbsLSpace;         // Distance Border<->Number
-    short               nLSpace;            // relative to the previous indentation
     short               nCharTextDistance;  // Distance Number<->Text
 
     // specifies what follows the list label before the text of the first line
@@ -202,8 +201,6 @@ public:
     SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const { return mePositionAndSpaceMode;}
     void SetPositionAndSpaceMode( SvxNumPositionAndSpaceMode ePositionAndSpaceMode );
 
-    void            SetLSpace(short nSet) {nLSpace = nSet;}
-    short           GetLSpace() const;
     void            SetAbsLSpace(short nSet) {nAbsLSpace = nSet;}
     short           GetAbsLSpace() const;
     void            SetFirstLineOffset(short nSet) { nFirstLineOffset = nSet;}
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 1c8a296..a081fa0 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1224,7 +1224,6 @@ void SdDrawDocument::SetTextDefaults() const
 
     SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
 
-    //aNumberFormat.SetLSpace( 0 );
     //aNumberFormat.SetAbsLSpace( 0 );
     //aNumberFormat.SetFirstLineOffset( 0 );
     //aNumRule.SetLevel( 0, aNumberFormat );
@@ -1232,7 +1231,6 @@ void SdDrawDocument::SetTextDefaults() const
     for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
     {
         const short nLSpace = (i + 1) * 600;
-        aNumberFormat.SetLSpace(nLSpace);
         aNumberFormat.SetAbsLSpace(nLSpace);
         aNumberFormat.SetFirstLineOffset(-600);
         aNumRule.SetLevel( i, aNumberFormat );
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 512df9c..cdd1aee 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1051,7 +1051,6 @@ void SdStyleSheetPool::setDefaultOutlineNumberFormatBulletAndIndent(sal_uInt16 i
     rNumberFormat.SetBulletChar( 0x25CF );  // StarBats: 0xF000 + 34
     rNumberFormat.SetBulletRelSize(45);
     const short nLSpace = (i + 1) * 1200;
-    rNumberFormat.SetLSpace(nLSpace);
     rNumberFormat.SetAbsLSpace(nLSpace);
     short nFirstLineOffset = -600;
 
@@ -1114,7 +1113,6 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
             for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
             {
                 const short nLSpace = (i + 1) * 600;
-                aNumberFormat.SetLSpace(nLSpace);
                 aNumberFormat.SetAbsLSpace(nLSpace);
                 aNumberFormat.SetFirstLineOffset(-600);
                 aNumRule.SetLevel( i, aNumberFormat );
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 2cf2594..c38924b 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -371,7 +371,6 @@ void TextObjectBar::Execute( SfxRequest &rReq )
                                 else
                                 {
                                     aFmt.SetNumberingType(SVX_NUM_NUMBER_NONE);
-                                    aFmt.SetLSpace(0);
                                     aFmt.SetAbsLSpace(0);
                                     aFmt.SetFirstLineOffset(0);
                                 }
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index ca2c2dc..e73f6bd 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -319,9 +319,6 @@ public:
     typedef std::multimap< SwNodeIndex, SwFrmFmt* >::const_iterator const_iterator;
     typedef std::pair< const_iterator, const_iterator > const_iterator_pair;
     const_iterator_pair equal_range( const SwNodeIndex& pos ) const;
-    const_iterator lower_bound( const SwNodeIndex& pos ) const;
-    const_iterator upper_bound( const SwNodeIndex& pos ) const;
-    const_iterator end() const;
 private:
     std::multimap< SwNodeIndex, SwFrmFmt* > items;
     const SwDoc* doc;
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index fce040d..5725862 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -408,7 +408,6 @@ SwNumRule::SwNumRule( const OUString& rNm,
             pFmt = new SwNumFmt;
             pFmt->SetIncludeUpperLevels( 1 );
             pFmt->SetStart( 1 );
-            pFmt->SetLSpace( lNumIndent );
             pFmt->SetAbsLSpace( lNumIndent + SwNumRule::GetNumIndent( n ) );
             pFmt->SetFirstLineOffset( lNumFirstLineOffset );
             pFmt->SetSuffix( "." );
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index d263dcf..54e710d 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -3369,19 +3369,4 @@ SwFrmFmtAnchorMap::const_iterator_pair SwFrmFmtAnchorMap::equal_range( const SwN
     return items.equal_range( pos );
 }
 
-SwFrmFmtAnchorMap::const_iterator SwFrmFmtAnchorMap::lower_bound( const SwNodeIndex& pos ) const
-{
-    return items.lower_bound( pos );
-}
-
-SwFrmFmtAnchorMap::const_iterator SwFrmFmtAnchorMap::upper_bound( const SwNodeIndex& pos ) const
-{
-    return items.upper_bound( pos );
-}
-
-SwFrmFmtAnchorMap::const_iterator SwFrmFmtAnchorMap::end() const
-{
-    return items.end();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index bb5efeb..492c1d2 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -492,7 +492,6 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
         aNumFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
         aNumFmt.SetBulletChar( cBulletChar );   // das Bulletzeichen !!
         aNumFmt.SetCharFmt( pCSS1Parser->GetCharFmtFromPool(RES_POOLCHR_BUL_LEVEL) );
-        aNumFmt.SetLSpace( (sal_uInt16)(-HTML_NUMBUL_INDENT) );
         aNumFmt.SetFirstLineOffset( HTML_NUMBUL_INDENT );
         aNumRule.Set( 0, aNumFmt );
 
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 0b46a67..2d10e4a 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -612,7 +612,6 @@ static void SetBaseAnlv(SwNumFmt &rNum, WW8_ANLV &rAV, sal_uInt8 nSwLevel )
     if( rAV.aBits1 & 0x08 )      //fHang
     {
         rNum.SetFirstLineOffset( -nIndent );
-        rNum.SetLSpace( nIndent );
         rNum.SetAbsLSpace( nIndent );
     }
     else
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index 6f4fafe..79fa813 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -161,7 +161,6 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
                     if ( n && bHtml )
                     {
                         // 1/2" for HTML
-                        aFmt.SetLSpace(720);
                         aFmt.SetAbsLSpace(n * 720);
                     }
                     // #i38904#  Default alignment for
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index aa58f59..d670343 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1234,7 +1234,6 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
                 if(bHtml && nLvl)
                 {
                     // 1/2" for HTML
-                    aFmt.SetLSpace(720);
                     aFmt.SetAbsLSpace(nLvl * 720);
                 }
                 else if ( nWidthOfTabs > 0 )
diff --git a/unusedcode.easy b/unusedcode.easy
index 2eb975d..58bd4f8 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -5,8 +5,13 @@ GDriveDocument::GDriveDocument(GDriveSession*)
 GDriveFolder::GDriveFolder(GDriveSession*)
 GDriveProperty::GDriveProperty()
 GDriveSession::GDriveSession()
+ImpBitmap::ImplSetSalBitmap(SalBitmap*)
 OpenGLContext::renderToFile()
+OpenGLContext::requestSingleBufferedRendering()
+OpenGLContext::requestVirtualDevice()
 OpenGLRender::CreateTextTexture(rtl::OUString const&, vcl::Font, long, com::sun::star::awt::Point, com::sun::star::awt::Size, long)
+OpenGLSalBitmap::Draw(OpenGLContext&, SalTwoRect const&)
+OpenGLTexture::OpenGLTexture()
 OutputDevice::GetCanvas() const
 OutputDevice::HasAlpha()
 OutputDevice::LogicHeightToDeviceCoordinate(long) const
@@ -187,6 +192,7 @@ sc::CLBuildKernelThread::produce()
 sc::CellValues::transferTo(ScColumn&, int)
 sd::LeftDrawPaneShell::RegisterInterface(SfxModule*)
 sd::LeftImpressPaneShell::RegisterInterface(SfxModule*)
+sdr::contact::ViewContactOfTextObj::GetTextObj() const
 sfx2::SvBaseLink::SvBaseLink(rtl::OUString const&, unsigned short, sfx2::SvLinkSource*)
 std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >::_Rb_tree(std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >&&)
 std::__cxx1998::vector<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread>, std::allocator<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread> > >::reserve(unsigned long)
commit c5e580abdb7fbd904e07ed0620e7acdbc382125f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 15:11:54 2014 +0000

    coverity#1130164 Unchecked return value
    
    Change-Id: I9d040b0a8862095ff7ac20b07642d60c17e54fce

diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index eb4584f..0f12f74 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -224,8 +224,8 @@ static bool lcl_ChgHyperLinkColor( const SwTxtAttr& rAttr,
                 rINetAttr.SetVisited(false);
                 const SwCharFmt* pTmpFmt = rINetAttr.GetCharFmt();
                 const SfxPoolItem* pItem;
-                pTmpFmt->GetItemState( RES_CHRATR_COLOR, true, &pItem );
-                *pColor = ((SvxColorItem*)pItem)->GetValue();
+                if (SfxItemState::SET == pTmpFmt->GetItemState(RES_CHRATR_COLOR, true, &pItem))
+                    *pColor = ((SvxColorItem*)pItem)->GetValue();
                 rINetAttr.SetVisited(true);
             }
             return true;
commit 9bf4b8c51d2dc2be892121349a63ab029a627fe8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 15:09:00 2014 +0000

    coverity#1187643 Unchecked return value
    
    Change-Id: I2ba56fbff1ae05d1185d08d4fbd0285954fed38b

diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx
index b988522..1485f02 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -76,15 +76,16 @@ sal_Int32 TextRun::insertAt(
             }
             else
             {
-                OUString aLatinFontName, aSymbolFontName;
                 sal_Int16 nSymbolFontFamily = 0, nSymbolFontPitch = 0;
 
                 if ( !aTextCharacterProps.maSymbolFont.getFontData( aSymbolFontName, nSymbolFontPitch, nSymbolFontFamily, rFilterBase ) )
                     xText->insertString( xStart, getText(), sal_False );
                 else if ( !getText().isEmpty() )
-                {   // !!#i113673<<<
+                {
+                    // #i113673
+                    OUString aLatinFontName, aSymbolFontName;
                     sal_Int16 nLatinFontPitch = 0, nLatinFontFamily = 0;
-                    aTextCharacterProps.maLatinFont.getFontData( aLatinFontName, nLatinFontPitch, nLatinFontFamily, rFilterBase );
+                    bool bLatinOk = aTextCharacterProps.maLatinFont.getFontData( aLatinFontName, nLatinFontPitch, nLatinFontFamily, rFilterBase );
 
                     sal_Int32 nIndex = 0;
                     while ( true )
@@ -109,9 +110,12 @@ sal_Int32 TextRun::insertAt(
                                 nCount++;
                             }
                             while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) != 0xf000 ) );
-                            aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) );
-                            aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) );
-                            aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) );
+                            if (bLatinOk)
+                            {
+                                aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) );
+                                aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) );
+                                aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) );
+                            }
                         }
                         OUString aSubString( getText().copy( nIndex, nCount ) );
                         xText->insertString( xStart, aSubString, sal_False );
commit 94ef826e67b3dcb02f690901b67ed51c93a9cfca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 10:33:10 2014 +0000

    coverity#1209861 untaint image data
    
    Change-Id: Icc3fd75533a6173f1cb051f3cd7a47d63e523652

diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx
index 9109f45c..130c7f2 100644
--- a/vcl/unx/generic/dtrans/bmp.cxx
+++ b/vcl/unx/generic/dtrans/bmp.cxx
@@ -54,16 +54,26 @@ inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer )
 
 inline sal_uInt16 readLE16( const sal_uInt8* pBuffer )
 {
-    return (((sal_uInt16)pBuffer[1]) << 8 ) | pBuffer[0];
+    //This is untainted data which comes from a controlled source
+    //so, using a byte-swapping pattern which coverity doesn't
+    //detect as such
+    //http://security.coverity.com/blog/2014/Apr/on-detecting-heartbleed-with-static-analysis.html
+    sal_uInt16 v = pBuffer[1]; v <<= 8;
+    v |= pBuffer[0];
+    return v;
 }
 
 inline sal_uInt32 readLE32( const sal_uInt8* pBuffer )
 {
-    return
-        (((sal_uInt32)pBuffer[3]) << 24 ) |
-        (((sal_uInt32)pBuffer[2]) << 16 ) |
-        (((sal_uInt32)pBuffer[1]) <<  8 ) |
-        pBuffer[0];
+    //This is untainted data which comes from a controlled source
+    //so, using a byte-swapping pattern which coverity doesn't
+    //detect as such
+    //http://security.coverity.com/blog/2014/Apr/on-detecting-heartbleed-with-static-analysis.html
+    sal_uInt32 v = pBuffer[3]; v <<= 8;
+    v |= pBuffer[2]; v <<= 8;
+    v |= pBuffer[1]; v <<= 8;
+    v |= pBuffer[0];
+    return v;
 }
 
 /*
commit 0cdfb1a2bb25d0e4b376875affed1d0621111d6b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 10:26:28 2014 +0000

    readLE32 should return a 32bit number, yikes!
    
    Change-Id: Ibf260ab97cc397b72d81ad4cc08f43d8d2128cef

diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx
index 7420b7f..9109f45c 100644
--- a/vcl/unx/generic/dtrans/bmp.cxx
+++ b/vcl/unx/generic/dtrans/bmp.cxx
@@ -57,7 +57,7 @@ inline sal_uInt16 readLE16( const sal_uInt8* pBuffer )
     return (((sal_uInt16)pBuffer[1]) << 8 ) | pBuffer[0];
 }
 
-inline sal_uInt16 readLE32( const sal_uInt8* pBuffer )
+inline sal_uInt32 readLE32( const sal_uInt8* pBuffer )
 {
     return
         (((sal_uInt32)pBuffer[3]) << 24 ) |
commit 0a272329f3cd82f75d860cff4e851c8e009a5109
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 10:19:09 2014 +0000

    Related: coverity#1242658 Untrusted loop bound
    
    Change-Id: I1e7e815c2800b4846498092239b0fadaa5d87b45

diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 43cdf5c..b6e2d77 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -989,8 +989,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
         if ( nRowBytes < 8 || nPackType == 1 )
         {
             const size_t nMaxPixels = pPict->remainingSize() / 4;
-            const size_t nMaxRows = nMaxPixels / nWidth;
-            if (nHeight > nMaxRows)
+            if (static_cast<size_t>(nHeight) * nWidth > nMaxPixels)
                 BITMAPERROR;
 
             for ( ny = 0; ny < nHeight; ny++ )
@@ -1006,8 +1005,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
         else if ( nPackType == 2 )
         {
             const size_t nMaxPixels = pPict->remainingSize() / 3;
-            const size_t nMaxRows = nMaxPixels / nWidth;
-            if (nHeight > nMaxRows)
+            if (static_cast<size_t>(nHeight) * nWidth > nMaxPixels)
                 BITMAPERROR;
 
             for ( ny = 0; ny < nHeight; ny++ )
commit 00e3da56f2a0698b20b3f72317bfe07f870556f8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 11 09:55:13 2014 +0000

    coverity#1242875 Use of untrusted scalar value
    
    Change-Id: I923fac826d5495af7caaa709dd2e844d8714c80b

diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 7055f2b..b86d25a 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -1331,10 +1331,15 @@ sal_uInt16 SfxItemPool::GetNewWhich
             SfxPoolVersion_ImplPtr pVerInfo = pImp->aVersions[nMap];
             if ( pVerInfo->_nVer > pImp->nLoadingVersion )
             {
-                DBG_ASSERT( nFileWhich >= pVerInfo->_nStart &&
-                            nFileWhich <= pVerInfo->_nEnd,
-                            "which-id unknown in version" );
-                nFileWhich = pVerInfo->_pMap[nFileWhich - pVerInfo->_nStart];
+                if (nFileWhich >= pVerInfo->_nStart &&
+                            nFileWhich <= pVerInfo->_nEnd)
+                {
+                    nFileWhich = pVerInfo->_pMap[nFileWhich - pVerInfo->_nStart];
+                }
+                else
+                {
+                    SAL_WARN("svl.items", "which-id unknown in version");
+                }
             }
         }
     }


More information about the Libreoffice-commits mailing list