editeng/source/editeng/impedit3.cxx | 9 +++++ editeng/source/items/frmitems.cxx | 24 ++++++++------- editeng/source/misc/splwrap.cxx | 4 +- editeng/source/misc/svxacorr.cxx | 48 +++++++++++++++++-------------- editeng/source/misc/txtrange.cxx | 3 - editeng/source/rtf/svxrtf.cxx | 28 +++++++++++------- include/editeng/splwrap.hxx | 6 --- include/editeng/txtrange.hxx | 16 ---------- sw/source/core/text/txtfly.cxx | 17 ----------- vcl/source/window/toolbox2.cxx | 55 ++++++++++-------------------------- 10 files changed, 85 insertions(+), 125 deletions(-)
New commits: commit 352ff66347d3e71e7091522a73c24a4bc65b9975 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 15:58:56 2014 -0600 Revert "hidpi: Blind fix - avoid double scaling by updating GetItemImage()." The GetItemImage change causes some controls to draw wrongly and have hit-testing problems. The change is broken because we want them to think the bitmap is big. One day LibreOffice will use large bitmaps. Some places call SetItemImage repeatedly, such as the font color dropdown control and so it needs a sanity check in SetItemImage. This reverts commit 0459682b4186b7522783e33cca3791420559817a. Change-Id: If208543def6467ad7d19e21edf0ab11e9a32f0f4 diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 90278a7..c29a4a6 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -622,17 +622,9 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::InsertItem(): ItemId already exists" ); - Image aImage(rImage); - if (GetDPIScaleFactor() > 1) - { - BitmapEx aBitmap(aImage.GetBitmapEx()); - aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); - aImage = Image(aBitmap); - } - - mpData->m_aItems.insert((nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), - ImplToolItem(nItemId, aImage, nBits)); - + // Item anlegen und in die Liste einfuegen + mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, nBits ) ); + SetItemImage(nItemId, rImage); mpData->ImplClearLayoutData(); ImplInvalidate( sal_True ); @@ -652,17 +644,9 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::InsertItem(): ItemId already exists" ); - Image aImage(rImage); - if (GetDPIScaleFactor() > 1) - { - BitmapEx aBitmap(aImage.GetBitmapEx()); - aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); - aImage = Image(aBitmap); - } - - mpData->m_aItems.insert((nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), - ImplToolItem(nItemId, aImage, ImplConvertMenuString(rText), nBits)); - + // Item anlegen und in die Liste einfuegen + mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, ImplConvertMenuString( rText ), nBits ) ); + SetItemImage(nItemId, rImage); mpData->ImplClearLayoutData(); ImplInvalidate( sal_True ); @@ -1369,11 +1353,17 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { Image aImage(rImage); - if (GetDPIScaleFactor() > 1) + if ( GetDPIScaleFactor() > 1) { BitmapEx aBitmap(aImage.GetBitmapEx()); - aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); - aImage = Image(aBitmap); + + // Some code calls this twice, so add a sanity check + // FIXME find out what that code is & fix accordingly + if (aBitmap.GetSizePixel().Width() < 32) + { + aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST); + aImage = Image(aBitmap); + } } ImplToolItem* pItem = &mpData->m_aItems[nPos]; @@ -1497,20 +1487,7 @@ Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) - { - Image aImage(pItem->maImage); - - if (GetDPIScaleFactor() > 1) - { - // we have scaled everything we have inserted, so scale it back to - // the original size - BitmapEx aBitmap(aImage.GetBitmapEx()); - aBitmap.Scale(1.0/GetDPIScaleFactor(), 1.0/GetDPIScaleFactor(), BMP_SCALE_FAST); - aImage = Image(aBitmap); - } - - return aImage; - } + return pItem->maImage; else return Image(); } commit 3d11e86363d28f44259760dae41487d45deefef1 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 15:00:17 2014 -0600 coverity#707768 Uninitialized scalar field Change-Id: I47b507d4e256572f879bab72cf99f007bb2df771 diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 44c16ee..d5cc5ab 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -60,18 +60,24 @@ static rtl_TextEncoding lcl_GetDefaultTextEncodingForRTF() SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, uno::Reference<document::XDocumentProperties> i_xDocProps, int bReadNewDoc ) - : SvRTFParser( rIn, 5 ), - rStrm(rIn), - pInsPos( 0 ), - pAttrPool( &rPool ), - m_xDocProps( i_xDocProps ), - pRTFDefaults( 0 ), - nVersionNo( 0 ) + : SvRTFParser( rIn, 5 ) + , rStrm(rIn) + , pInsPos( 0 ) + , pAttrPool( &rPool ) + , m_xDocProps( i_xDocProps ) + , pRTFDefaults( 0 ) + , nVersionNo( 0 ) + , nDfltFont( 0) + , bNewDoc( bReadNewDoc ) + , bNewGroup( sal_False) + , bIsSetDfltTab( sal_False) + , bChkStyleAttr( sal_False ) + , bCalcValue( sal_False ) + , bPardTokenRead( sal_False) + , bReadDocInfo( sal_False ) + , bIsLeftToRightDef( sal_True) + , bIsInReadStyleTab( sal_False) { - bNewDoc = bReadNewDoc; - - bChkStyleAttr = bCalcValue = bReadDocInfo = bIsInReadStyleTab = sal_False; - bIsLeftToRightDef = sal_True; { RTFPlainAttrMapIds aTmp( rPool ); commit 0f2a8ec5e0d2b41a3845801682be526a528540cf Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 14:35:21 2014 -0600 coverity#707765 Uninitialized scalar field Change-Id: I35194385cc2f5d02a93ade0e8ab40fb77eba7e6e diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index a3da04c..1790b82 100644 --- a/editeng/source/misc/txtrange.cxx +++ b/editeng/source/misc/txtrange.cxx @@ -42,9 +42,6 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, bInner( bInnr ), bVertical( bVert ) { -#ifdef DBG_UTIL - bFlag3 = bFlag4 = bFlag5 = bFlag6 = bFlag7 = sal_False; -#endif sal_uInt32 nCount(rPolyPolygon.count()); mpPolyPolygon = new PolyPolygon( (sal_uInt16)nCount ); diff --git a/include/editeng/txtrange.hxx b/include/editeng/txtrange.hxx index ce75662..dd9af49 100644 --- a/include/editeng/txtrange.hxx +++ b/include/editeng/txtrange.hxx @@ -63,11 +63,7 @@ class EDITENG_DLLPUBLIC TextRanger sal_Bool bInner : 1; // TRUE: Objekt inline (EditEngine); // FALSE: Objekt flow (StarWriter); sal_Bool bVertical :1; // for vertical writing mode - sal_Bool bFlag3 :1; - sal_Bool bFlag4 :1; - sal_Bool bFlag5 :1; - sal_Bool bFlag6 :1; - sal_Bool bFlag7 :1; + TextRanger( const TextRanger& ); // not implemented const Rectangle& _GetBoundRect(); public: @@ -93,16 +89,6 @@ public: void SetUpper( sal_uInt16 nNew ){ nUpper = nNew; } void SetLower( sal_uInt16 nNew ){ nLower = nNew; } void SetVertical( sal_Bool bNew ); - sal_Bool IsFlag3() const { return bFlag3; } - void SetFlag3( sal_Bool bNew ) { bFlag3 = bNew; } - sal_Bool IsFlag4() const { return bFlag4; } - void SetFlag4( sal_Bool bNew ) { bFlag4 = bNew; } - sal_Bool IsFlag5() const { return bFlag5; } - void SetFlag5( sal_Bool bNew ) { bFlag5 = bNew; } - sal_Bool IsFlag6() const { return bFlag6; } - void SetFlag6( sal_Bool bNew ) { bFlag6 = bNew; } - sal_Bool IsFlag7() const { return bFlag7; } - void SetFlag7( sal_Bool bNew ) { bFlag7 = bNew; } }; diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 8d9dca0..0301f3b 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -257,22 +257,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt, pTextRanger[ 0 ]->SetLower( rULSpace.GetLower() ); delete pPolyPolygon; - // UPPER_LOWER_TEST -#ifdef DBG_UTIL - const SwViewShell* pTmpViewShell = pFmt->GetDoc()->GetCurrentViewShell(); - if( pTmpViewShell ) - { - sal_Bool bT2 = pTmpViewShell->GetViewOptions()->IsTest2(); - sal_Bool bT6 = pTmpViewShell->GetViewOptions()->IsTest6(); - if( bT2 || bT6 ) - { - if( bT2 ) - pTextRanger[ 0 ]->SetFlag7( sal_True ); - else - pTextRanger[ 0 ]->SetFlag6( sal_True ); - } - } -#endif + nPntCnt += pTextRanger[ 0 ]->GetPointCount(); while( nPntCnt > POLY_MAX && nObjCnt > POLY_MIN ) { commit bb688f72cc93bd48f20b09b9673712a6a64b40ff Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 13:37:06 2014 -0600 coverity#707764 Uninitialized scalar field Change-Id: Ibbd13e15b6aca33a8c9050dd0d9f210e64e85e3e diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 3f119d1..651b380 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -278,31 +278,37 @@ long SvxAutoCorrect::GetDefaultFlags() SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile, const OUString& rUserAutocorrFile ) - : sShareAutoCorrFile( rShareAutocorrFile ), - sUserAutoCorrFile( rUserAutocorrFile ), - pLangTable( new boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists> ), - pCharClass( 0 ), bRunNext( false ), eCharClassLang( LANGUAGE_DONTKNOW ), - cStartDQuote( 0 ), cEndDQuote( 0 ), cStartSQuote( 0 ), cEndSQuote( 0 ) + : sShareAutoCorrFile( rShareAutocorrFile ) + , sUserAutoCorrFile( rUserAutocorrFile ) + , pLangTable( new boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists> ) + , pCharClass( 0 ) + , bRunNext( false ) + , eCharClassLang( LANGUAGE_DONTKNOW ) + , nFlags(SvxAutoCorrect::GetDefaultFlags()) + , cStartDQuote( 0 ) + , cEndDQuote( 0 ) + , cStartSQuote( 0 ) + , cEndSQuote( 0 ) + , cEmDash( 0x2014 ) + , cEnDash( 0x2013) { - nFlags = SvxAutoCorrect::GetDefaultFlags(); - - cEmDash = 0x2014; - cEnDash = 0x2013; } SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy ) -: sShareAutoCorrFile( rCpy.sShareAutoCorrFile ), - sUserAutoCorrFile( rCpy.sUserAutoCorrFile ), - - aSwFlags( rCpy.aSwFlags ), - - pLangTable( new boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists> ), - pCharClass( 0 ), bRunNext( false ), - - nFlags( rCpy.nFlags & ~(ChgWordLstLoad|CplSttLstLoad|WrdSttLstLoad)), - cStartDQuote( rCpy.cStartDQuote ), cEndDQuote( rCpy.cEndDQuote ), - cStartSQuote( rCpy.cStartSQuote ), cEndSQuote( rCpy.cEndSQuote ), - cEmDash( rCpy.cEmDash ), cEnDash( rCpy.cEnDash ) + : sShareAutoCorrFile( rCpy.sShareAutoCorrFile ) + , sUserAutoCorrFile( rCpy.sUserAutoCorrFile ) + , aSwFlags( rCpy.aSwFlags ) + , pLangTable( new boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists> ) + , pCharClass( 0 ) + , bRunNext( false ) + , eCharClassLang(rCpy.eCharClassLang) + , nFlags( rCpy.nFlags & ~(ChgWordLstLoad|CplSttLstLoad|WrdSttLstLoad)) + , cStartDQuote( rCpy.cStartDQuote ) + , cEndDQuote( rCpy.cEndDQuote ) + , cStartSQuote( rCpy.cStartSQuote ) + , cEndSQuote( rCpy.cEndSQuote ) + , cEmDash( rCpy.cEmDash ) + , cEnDash( rCpy.cEnDash ) { } commit 5c5d31b04c4a856a103312064e87f50ddd385474 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 12:18:53 2014 -0600 coverity#707761-62 Uninitialized scalar field Change-Id: I9ebd8df6e510640e511a61332ab1d712b68c40ca diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index e5bd328..730f7ec 100644 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -64,8 +64,8 @@ void SvxPrepareAutoCorrect( OUString &rOldText, const OUString &rNewText ) // rOldText: text to be replaced // rNewText: replacement text - sal_Int32 nOldLen = rOldText.getLength(), - nNewLen = rNewText.getLength(); + sal_Int32 nOldLen = rOldText.getLength(); + sal_Int32 nNewLen = rNewText.getLength(); if (nOldLen && nNewLen) { bool bOldHasDot = '.' == rOldText[ nOldLen - 1 ], diff --git a/include/editeng/splwrap.hxx b/include/editeng/splwrap.hxx index 754c4d0..d2fb651 100644 --- a/include/editeng/splwrap.hxx +++ b/include/editeng/splwrap.hxx @@ -56,7 +56,6 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > xHyph; SdrObject* mpTextObj; - sal_uInt16 nOldLang; // Set Language, only call SetLanguage on changes sal_Bool bOtherCntnt : 1; // set => Check special sections initially sal_Bool bDialog : 1; // Is pWin the Svx...Dialog? sal_Bool bHyphen : 1; // Split instead of spell checking @@ -111,11 +110,6 @@ public: GetXHyphenator() { return xHyph; } inline sal_Bool IsAllRight() { return bAllRight; } inline Window* GetWin() { return pWin; } - // can possibly be omitted in ONE_LINGU: - inline void SetOldLang( const sal_uInt16 nNew ){ nOldLang = nNew; } - // can possibly be omitted in ONE_LINGU: - inline void ChangeLanguage( const sal_uInt16 nNew ) // call SetLanguage if needed. - { if ( nNew != nOldLang ) { SetLanguage( nNew ); nOldLang = nNew; } } inline void EnableAutoCorrect() { bAuto = sal_True; } protected: commit 5523ed4b3571a22c32357459fd4f4976d32a341f Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 12:00:20 2014 -0600 coverity#707757 Uninitialized scalar field Change-Id: I3956259474b100d0d14d500f9528b04125e0d169 diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index cb880e3..d07ffd2 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -4166,6 +4166,10 @@ SvxBrushItem::SvxBrushItem( const CntWallpaperItem& rItem, sal_uInt16 _nWhich ) maStrLink = rItem.GetBitmapURL(); SetGraphicPos( WallpaperStyle2GraphicPos((WallpaperStyle)rItem.GetStyle() ) ); } + else + { + SetGraphicPos( GPOS_NONE ); + } } void SvxBrushItem::ApplyGraphicTransparency_Impl() commit ffc7f286068dfafa2d16f666bbb9035e666b1193 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 11:56:47 2014 -0600 coverity#707756 Uninitialized scalar field Change-Id: I9985284e852ddc3b29d75cdf0b8969c2a8cecb9a diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 8c7c25c..cb880e3 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3461,17 +3461,15 @@ SvxBrushItem::SvxBrushItem( // ----------------------------------------------------------------------- SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion, - sal_uInt16 _nWhich ) : - - SfxPoolItem( _nWhich ), - - aColor ( COL_TRANSPARENT ), - nShadingValue ( ShadingPattern::CLEAR ), - pImpl ( new SvxBrushItem_Impl( NULL ) ), - maStrLink (), - maStrFilter (), - eGraphicPos ( GPOS_NONE ) - + sal_uInt16 _nWhich ) + : SfxPoolItem( _nWhich ) + , aColor ( COL_TRANSPARENT ) + , nShadingValue ( ShadingPattern::CLEAR ) + , pImpl ( new SvxBrushItem_Impl( NULL ) ) + , maStrLink () + , maStrFilter () + , eGraphicPos ( GPOS_NONE ) + , bLoadAgain (sal_False) { sal_Bool bTrans; Color aTempColor; commit 69afd67fe2e40c8c735f87b2fa21d797c6ef4844 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Wed Feb 5 11:52:06 2014 -0600 coverity#707754 Uninitialized scalar field Change-Id: I4de0a0857ce87266c3f3c4993efc45b12539156c diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ff80d97..e124021 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -95,7 +95,14 @@ struct TabInfo long nStartPosX; long nTabPos; - TabInfo() { bValid = false; } + TabInfo() + : bValid(false) + , nCharPos(0) + , nTabPortion(0) + , nStartPosX(0) + , nTabPos(0) + { } + }; Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits