cui/source/options/fontsubs.cxx | 2 cui/source/tabpages/chardlg.cxx | 18 ++--- cui/source/tabpages/numpages.cxx | 2 editeng/source/editeng/editview.cxx | 2 framework/source/uielement/fontsizemenucontroller.cxx | 2 include/svtools/ctrlbox.hxx | 6 - include/svtools/ctrltool.hxx | 24 +++---- include/svtools/stdmenu.hxx | 6 + include/vcl/metric.hxx | 13 +--- include/vcl/outdev.hxx | 7 +- sc/source/filter/excel/excrecds.cxx | 3 sc/source/filter/excel/xecontent.cxx | 2 sc/source/filter/excel/xehelper.cxx | 2 sc/source/filter/excel/xistyle.cxx | 2 sc/source/filter/inc/pivotcachebuffer.hxx | 2 sc/source/filter/oox/pivotcachebuffer.cxx | 2 sc/source/filter/xml/xmldpimp.cxx | 1 starmath/source/dialog.cxx | 2 svtools/source/control/ctrlbox.cxx | 12 +-- svtools/source/control/ctrltool.cxx | 58 +++++------------- svtools/source/control/stdmenu.cxx | 4 - svx/source/mnuctrls/fntszctl.cxx | 2 svx/source/sidebar/nbdtmg.cxx | 44 ++++++------- svx/source/sidebar/text/SvxSBFontNameBox.cxx | 2 svx/source/sidebar/text/TextPropertyPanel.cxx | 2 svx/source/tbxctrls/tbcontrl.cxx | 4 - svx/source/tbxctrls/tbunocontroller.cxx | 2 sw/source/core/unocore/unocrsrhelper.cxx | 2 sw/source/core/unocore/unosett.cxx | 2 sw/source/core/unocore/unostyle.cxx | 2 sw/source/filter/html/svxcss1.cxx | 2 sw/source/filter/html/swhtml.cxx | 2 sw/source/ui/config/optpage.cxx | 6 - sw/source/ui/dialog/ascfldlg.cxx | 2 sw/source/ui/docvw/srcedtw.cxx | 2 vcl/source/gdi/metric.cxx | 12 ++- vcl/workben/svptest.cxx | 2 37 files changed, 121 insertions(+), 141 deletions(-)
New commits: commit cb69529953b90581d06d4f1ce4c988bd43eac300 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Wed Jun 4 23:37:40 2014 +0200 make that variable protected again Change-Id: I17235397e490458c250165c36bec97bf1ce326d7 diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index 1836cce..e746e57 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -33,9 +33,10 @@ namespace vcl { class VCL_DLLPUBLIC FontInfo : public Font { - friend class OutputDevice; + friend class ::OutputDevice; protected: + ImplFontMetric* mpImplMetric; // Implementation public: FontInfo(); @@ -48,7 +49,6 @@ public: sal_Bool operator==( const FontInfo& ) const; sal_Bool operator!=( const FontInfo& rInfo ) const { return !operator==( rInfo ); } - ImplFontMetric* mpImplMetric; // Implementation }; } commit d4029e62e7e3e7f58840753b368b20ef87cb3c11 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Wed Jun 4 07:48:15 2014 +0200 avoid problems with poppler's and vcl's FontInfo during runtime Change-Id: I1dbd256812cccae1e6ed0ad8bb34ce427e5e5be8 Conflicts: include/vcl/metric.hxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrltool.cxx svtools/source/control/stdmenu.cxx svx/source/sidebar/nbdtmg.cxx Conflicts: include/svtools/ctrltool.hxx include/vcl/metric.hxx include/vcl/outdev.hxx svtools/source/control/ctrlbox.cxx svtools/source/control/ctrltool.cxx svtools/source/control/stdmenu.cxx svx/source/sidebar/nbdtmg.cxx sw/source/core/uibase/docvw/srcedtw.cxx vcl/source/gdi/metric.cxx vcl/source/outdev/font.cxx diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 06afeb5..00a84b3 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -326,7 +326,7 @@ IMPL_LINK(SvxFontSubstTabPage, NonPropFontsHdl, CheckBox*, pBox) sal_uInt16 nFontCount = aFntLst.GetFontNameCount(); for(sal_uInt16 nFont = 0; nFont < nFontCount; nFont++) { - const FontInfo& rInfo = aFntLst.GetFontName( nFont ); + const vcl::FontInfo& rInfo = aFntLst.GetFontName( nFont ); if(!bNonPropOnly || rInfo.GetPitch() == PITCH_FIXED) m_pFontNameLB->InsertEntry(rInfo.GetName()); } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 28222fa..9d82ad0 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -435,7 +435,7 @@ const FontList* SvxCharNamePage::GetFontList() const // ----------------------------------------------------------------------------- namespace { - FontInfo calcFontInfo( SvxFont& _rFont, + vcl::FontInfo calcFontInfo( SvxFont& _rFont, SvxCharNamePage* _pPage, const FontNameBox* _pFontNameLB, const FontStyleBox* _pFontStyleLB, @@ -447,7 +447,7 @@ namespace { Size aSize = _rFont.GetSize(); aSize.Width() = 0; - FontInfo aFontInfo; + vcl::FontInfo aFontInfo; OUString sFontName(_pFontNameLB->GetText()); sal_Bool bFontAvailable = _pFontList->IsAvailable( sFontName ); if (bFontAvailable || _pFontNameLB->GetSavedValue() != sFontName) @@ -520,19 +520,19 @@ void SvxCharNamePage::UpdatePreview_Impl() // Font const FontList* pFontList = GetFontList(); - FontInfo aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB, + vcl::FontInfo aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB, m_pWestFontStyleLB, m_pWestFontSizeLB, m_pWestFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_FONT), GetWhich(SID_ATTR_CHAR_FONTHEIGHT)); m_pWestFontTypeFT->SetText(pFontList->GetFontMapText(aWestFontInfo)); - FontInfo aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB, + vcl::FontInfo aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB, m_pEastFontStyleLB, m_pEastFontSizeLB, m_pEastFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CJK_FONT), GetWhich(SID_ATTR_CHAR_CJK_FONTHEIGHT)); m_pEastFontTypeFT->SetText(pFontList->GetFontMapText(aEastFontInfo)); - FontInfo aCTLFontInfo = calcFontInfo(rCTLFont, + vcl::FontInfo aCTLFontInfo = calcFontInfo(rCTLFont, this, m_pCTLFontNameLB, m_pCTLFontStyleLB, m_pCTLFontSizeLB, m_pCTLFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CTL_FONT), GetWhich(SID_ATTR_CHAR_CTL_FONTHEIGHT)); @@ -609,7 +609,7 @@ void SvxCharNamePage::FillSizeBox_Impl( const FontNameBox* pNameBox ) return; } - FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); + vcl::FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); pSizeBox->Fill( &_aFontInfo, pFontList ); } @@ -720,7 +720,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp // currently chosen font if ( bStyle && pFontItem ) { - FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); + vcl::FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); } else if ( !m_pImpl->m_bInSearchMode || !bStyle ) @@ -729,7 +729,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp } else if ( bStyle ) { - FontInfo aInfo = pFontList->Get( OUString(), eWeight, eItalic ); + vcl::FontInfo aInfo = pFontList->Get( OUString(), eWeight, eItalic ); pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); } if (!bStyleAvailable) @@ -891,7 +891,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan sal_uInt16 nEntryPos = pStyleBox->GetEntryPos( aStyleBoxText ); if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) aStyleBoxText = ""; - FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); + vcl::FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetName(), aInfo.GetStyleName(), aInfo.GetPitch(), aInfo.GetCharSet(), nWhich ); pOld = GetOldItem( rSet, nSlot ); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index d646da2..9fb9589 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -708,7 +708,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl) } if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) { - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 18b0c9a..4818c18 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1326,7 +1326,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo const SfxMapUnit eUnit = rSet.GetPool()->GetMetric( *pWhich ); nHeight = OutputDevice::LogicToLogic( nHeight * 10, (MapUnit)eUnit, MAP_POINT ); - FontInfo aFontInfo = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() ); + vcl::FontInfo aFontInfo = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() ); const sal_IntPtr* pAry = pFontList->GetSizeAry( aFontInfo ); if( bGrow ) diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index 72f5c7e..c4974d4 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -153,7 +153,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r if ( pFontList == 0 ) pFontList = new FontList( Application::GetDefaultDevice() ); - FontInfo aFntInfo = pFontList->Get( m_aFontDescriptor.Name, m_aFontDescriptor.StyleName ); + vcl::FontInfo aFntInfo = pFontList->Get( m_aFontDescriptor.Name, m_aFontDescriptor.StyleName ); // setup font size array if ( m_pHeightArray ) diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 6599091..2727301 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -35,7 +35,7 @@ class ImpLineListData; typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImpLineListData* > ImpLineList; -typedef ::std::vector< FontInfo > ImplFontList; +typedef ::std::vector< vcl::FontInfo > ImplFontList; // FIXME: STYLE_* duplicate values from editeng::SvxBorderStyle, // which in turn duplicates values from com::sun::star::table::BorderLineStyle: @@ -488,7 +488,7 @@ inline void FontStyleBox::SetText( const OUString& rText ) class SVT_DLLPUBLIC FontSizeBox : public MetricBox { - FontInfo aFontInfo; + vcl::FontInfo aFontInfo; const FontList* pFontList; sal_uInt16 nRelMin; sal_uInt16 nRelMax; @@ -514,7 +514,7 @@ public: void Reformat(); void Modify(); - void Fill( const FontInfo* pInfo, const FontList* pList ); + void Fill( const vcl::FontInfo* pInfo, const FontList* pList ); void EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150, sal_uInt16 nStep = 5 ); diff --git a/include/svtools/ctrltool.hxx b/include/svtools/ctrltool.hxx index 65b19e3..a72702a 100644 --- a/include/svtools/ctrltool.hxx +++ b/include/svtools/ctrltool.hxx @@ -75,7 +75,7 @@ scalierbare Schriften abgefragt. -------------------------------------------------------------------------- -String FontList::GetStyleName( const FontInfo& rInfo ) const; +String FontList::GetStyleName( const vcl::FontInfo& rInfo ) const; Diese Methode gibt den StyleName von einer FontInfo zurueck. Falls kein StyleName gesetzt ist, wird aus den gesetzten Attributen ein entsprechender @@ -83,14 +83,14 @@ Name generiert, der dem Anwender praesentiert werden kann. -------------------------------------------------------------------------- -OUString FontList::GetFontMapText( const FontInfo& rInfo ) const; +OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const; Diese Methode gibt einen Matchstring zurueck, der dem Anwender anzeigen soll, welche Probleme es mit diesem Font geben kann. -------------------------------------------------------------------------- -FontInfo FontList::Get( const String& rName, const String& rStyleName ) const; +vcl::FontInfo FontList::Get( const String& rName, const String& rStyleName ) const; Diese Methode sucht aus dem uebergebenen Namen und dem uebergebenen StyleName die entsprechende FontInfo-Struktur raus. Der Stylename kann in dieser @@ -106,7 +106,7 @@ FontList::GetStyleName() -------------------------------------------------------------------------- -FontInfo FontList::Get( const String& rName, FontWeight eWeight, +vcl::FontInfo FontList::Get( const String& rName, FontWeight eWeight, FontItalic eItalic ) const; Diese Methode sucht aus dem uebergebenen Namen und den uebergebenen Styles @@ -121,7 +121,7 @@ FontList::GetStyleName() -------------------------------------------------------------------------- -const sal_IntPtr* FontList::GetSizeAry( const FontInfo& rInfo ) const; +const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const; Diese Methode liefert zum uebergebenen Font die vorhandenen Groessen. Falls es sich dabei um einen skalierbaren Font handelt, werden Standard- @@ -178,18 +178,18 @@ public: OutputDevice* GetDevice() const { return mpDev; } OutputDevice* GetDevice2() const { return mpDev2; } - OUString GetFontMapText( const FontInfo& rInfo ) const; + OUString GetFontMapText( const vcl::FontInfo& rInfo ) const; const OUString& GetNormalStr() const { return maNormal; } const OUString& GetItalicStr() const { return maNormalItalic; } const OUString& GetBoldStr() const { return maBold; } const OUString& GetBoldItalicStr() const { return maBoldItalic; } const OUString& GetStyleName( FontWeight eWeight, FontItalic eItalic ) const; - OUString GetStyleName( const FontInfo& rInfo ) const; + OUString GetStyleName( const vcl::FontInfo& rInfo ) const; - FontInfo Get( const OUString& rName, + vcl::FontInfo Get( const OUString& rName, const OUString& rStyleName ) const; - FontInfo Get( const OUString& rName, + vcl::FontInfo Get( const OUString& rName, FontWeight eWeight, FontItalic eItalic ) const; @@ -198,12 +198,12 @@ public: { return (sal_uInt16)maEntries.size(); } - const FontInfo& GetFontName( sal_uInt16 nFont ) const; + const vcl::FontInfo& GetFontName( sal_uInt16 nFont ) const; sal_Handle GetFirstFontInfo( const OUString& rName ) const; sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const; - const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const; + const vcl::FontInfo& GetFontInfo( sal_Handle hFontInfo ) const; - const sal_IntPtr* GetSizeAry( const FontInfo& rInfo ) const; + const sal_IntPtr* GetSizeAry( const vcl::FontInfo& rInfo ) const; static const sal_IntPtr* GetStdSizeAry(); private: diff --git a/include/svtools/stdmenu.hxx b/include/svtools/stdmenu.hxx index fd0f186..4385881 100644 --- a/include/svtools/stdmenu.hxx +++ b/include/svtools/stdmenu.hxx @@ -25,7 +25,9 @@ #include <vcl/menu.hxx> class FontList; -class FontInfo; +namespace vcl { + class FontInfo; +} /************************************************************************* @@ -145,7 +147,7 @@ public: virtual void Select(); virtual void Highlight(); - void Fill( const FontInfo& rInfo, const FontList* pList ); + void Fill( const vcl::FontInfo& rInfo, const FontList* pList ); void SetCurHeight( long nHeight ); long GetCurHeight() const { return mnCurHeight; } diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index 9b6efe6..1836cce 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -22,22 +22,20 @@ #include <vcl/dllapi.h> #include <vcl/font.hxx> +#include <vcl/outdev.hxx> class ImplFontMetric; class ImplFontCharMap; typedef sal_uInt32 sal_UCS4; -// ------------ -// - FontInfo - -// ------------ +namespace vcl { class VCL_DLLPUBLIC FontInfo : public Font { friend class OutputDevice; protected: - ImplFontMetric* mpImplMetric; // Implementation public: FontInfo(); @@ -50,13 +48,12 @@ public: sal_Bool operator==( const FontInfo& ) const; sal_Bool operator!=( const FontInfo& rInfo ) const { return !operator==( rInfo ); } + ImplFontMetric* mpImplMetric; // Implementation }; -// -------------- -// - FontMetric - -// -------------- +} -class VCL_DLLPUBLIC FontMetric : public FontInfo +class VCL_DLLPUBLIC FontMetric : public vcl::FontInfo { public: FontMetric() {} diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index d7e2bf4..48ebd50 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -59,7 +59,6 @@ class BitmapReadAccess; class BitmapEx; class Image; class TextRectInfo; -class FontInfo; class FontMetric; class GDIMetaFile; class GfxLink; @@ -257,6 +256,10 @@ class FontSelectPattern; class ImplFontMetricData; class VCLXGraphics; +namespace vcl { + class FontInfo; +} + typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl; const char* ImplDbgCheckOutputDevice( const void* pObj ); @@ -1081,7 +1084,7 @@ public: sal_Bool AddTempDevFont( const OUString& rFileURL, const OUString& rFontName ); int GetDevFontCount() const; - FontInfo GetDevFont( int nDevFontIndex ) const; + vcl::FontInfo GetDevFont( int nDevFontIndex ) const; int GetDevFontSizeCount( const Font& ) const; Size GetDevFontSize( const Font& rFont, int nSizeIndex ) const; sal_Bool IsFontAvailable( const OUString& rFontName ) const; diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 2e6b4cf..98f8b12 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -745,7 +745,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico aParaText = "&\"" + OUString(aNewData.maName); if( pFontList ) { - FontInfo aFontInfo( pFontList->Get( + vcl::FontInfo aFontInfo( pFontList->Get( aNewData.maName, (aNewData.mnWeight > EXC_FONTWGHT_NORMAL) ? WEIGHT_BOLD : WEIGHT_NORMAL, aNewData.mbItalic ? ITALIC_NORMAL : ITALIC_NONE ) ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 203eda6..6e5543c 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -200,7 +200,7 @@ void XclImpFont::SetFontData( const XclFontData& rFontData, bool bHasCharSet ) { if( const FontList* pFontList = pInfoItem->GetFontList() ) { - FontInfo aFontInfo( pFontList->Get( maData.maName, maData.maStyle ) ); + vcl::FontInfo aFontInfo( pFontList->Get( maData.maName, maData.maStyle ) ); maData.SetScWeight( aFontInfo.GetWeight() ); maData.SetScPosture( aFontInfo.GetItalic() ); } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index fc9641b..8b10de6 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2280,7 +2280,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyleName) { // get Font (FontInfo) matching name and style - FontInfo aFI; + vcl::FontInfo aFI; if (pFontList) aFI = pFontList->Get(rFontName, WEIGHT_NORMAL, ITALIC_NONE); SetFontStyle(rStyleName, aFI); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 9250f30..1b7441e 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1128,7 +1128,7 @@ void FontNameBox::Fill( const FontList* pList ) sal_uInt16 nFontCount = pList->GetFontNameCount(); for ( sal_uInt16 i = 0; i < nFontCount; i++ ) { - const FontInfo& rFontInfo = pList->GetFontName( i ); + const vcl::FontInfo& rFontInfo = pList->GetFontName( i ); sal_uLong nIndex = InsertEntry( rFontInfo.GetName() ); if ( nIndex != LISTBOX_ERROR ) { @@ -1208,13 +1208,11 @@ namespace } } -// ------------------------------------------------------------------- - void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) { assert( mpFontList ); - FontInfo& rInfo = (*mpFontList)[ rUDEvt.GetItemId() ]; + vcl::FontInfo& rInfo = (*mpFontList)[ rUDEvt.GetItemId() ]; Point aTopLeft = rUDEvt.GetRect().TopLeft(); long nX = aTopLeft.X(); long nH = rUDEvt.GetRect().GetHeight(); @@ -1515,7 +1513,7 @@ void FontStyleBox::Fill( const OUString& rName, const FontList* pList ) sal_Bool bBold = sal_False; sal_Bool bBoldItalic = sal_False; sal_Bool bInsert = sal_False; - FontInfo aInfo; + vcl::FontInfo aInfo; while ( hFontInfo ) { aInfo = pList->GetFontInfo( hFontInfo ); @@ -1751,9 +1749,7 @@ void FontSizeBox::Modify() } } -// ----------------------------------------------------------------------- - -void FontSizeBox::Fill( const FontInfo* pInfo, const FontList* pList ) +void FontSizeBox::Fill( const vcl::FontInfo* pInfo, const FontList* pList ) { // remember for relative mode pFontList = pList; diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index 4f8fc91..a448876 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -68,13 +68,7 @@ static const sal_IntPtr aStdSizeAry[] = 0 }; -// ======================================================================= - -// ----------------------------- -// - class ImplFontListFonInfo - -// ----------------------------- - -class ImplFontListFontInfo : public FontInfo +class ImplFontListFontInfo : public vcl::FontInfo { friend class FontList; @@ -83,9 +77,9 @@ private: ImplFontListFontInfo* mpNext; public: - ImplFontListFontInfo( const FontInfo& rInfo, + ImplFontListFontInfo( const vcl::FontInfo& rInfo, OutputDevice* pDev ) : - FontInfo( rInfo ), mpNext(NULL) + vcl::FontInfo( rInfo ), mpNext(NULL) { mpDevice = pDev; } @@ -258,7 +252,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll, sal_uInt16 i; for( i = 0; i < n; i++ ) { - FontInfo aFontInfo = pDevice->GetDevFont( i ); + vcl::FontInfo aFontInfo = pDevice->GetDevFont( i ); // Wenn keine Raster-Schriften angezeigt werden sollen, // dann diese ignorieren @@ -307,7 +301,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll, (pNewInfo->GetCharSet() == eSystemEncoding) ) { ImplFontListFontInfo* pTemp2 = pTemp->mpNext; - *((FontInfo*)pTemp) = *((FontInfo*)pNewInfo); + *((vcl::FontInfo*)pTemp) = *((vcl::FontInfo*)pNewInfo); pTemp->mpNext = pTemp2; } delete pNewInfo; @@ -442,9 +436,7 @@ const OUString& FontList::GetStyleName(FontWeight eWeight, FontItalic eItalic) c } } -// ----------------------------------------------------------------------- - -OUString FontList::GetStyleName(const FontInfo& rInfo) const +OUString FontList::GetStyleName(const vcl::FontInfo& rInfo) const { OUString aStyleName = rInfo.GetStyleName(); FontWeight eWeight = rInfo.GetWeight(); @@ -496,9 +488,7 @@ OUString FontList::GetStyleName(const FontInfo& rInfo) const return aStyleName; } -// ----------------------------------------------------------------------- - -OUString FontList::GetFontMapText( const FontInfo& rInfo ) const +OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const { if ( rInfo.GetName().isEmpty() ) { @@ -573,11 +563,11 @@ OUString FontList::GetFontMapText( const FontInfo& rInfo ) const namespace { - FontInfo makeMissing(ImplFontListFontInfo* pFontNameInfo, const OUString &rName, + vcl::FontInfo makeMissing(ImplFontListFontInfo* pFontNameInfo, const OUString &rName, FontWeight eWeight, FontItalic eItalic) { - FontInfo aInfo; - // Falls der Fontname stimmt, uebernehmen wir soviel wie moeglich + vcl::FontInfo aInfo; + // if the fontname matches, we copy as much as possible if (pFontNameInfo) { aInfo = *pFontNameInfo; @@ -596,7 +586,7 @@ namespace } } -FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const +vcl::FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const { ImplFontListNameInfo* pData = ImplFindByName( rName ); ImplFontListFontInfo* pFontInfo = NULL; @@ -618,9 +608,8 @@ FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const } } - // Konnten die Daten nicht gefunden werden, dann muessen bestimmte - // Attribute nachgebildet werden - FontInfo aInfo; + // reproduce attributes if data could not be found + vcl::FontInfo aInfo; if ( !pFontInfo ) { FontWeight eWeight = WEIGHT_DONTKNOW; @@ -678,9 +667,7 @@ FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const return aInfo; } -// ----------------------------------------------------------------------- - -FontInfo FontList::Get(const OUString& rName, +vcl::FontInfo FontList::Get(const OUString& rName, FontWeight eWeight, FontItalic eItalic) const { ImplFontListNameInfo* pData = ImplFindByName( rName ); @@ -703,9 +690,8 @@ FontInfo FontList::Get(const OUString& rName, } } - // Konnten die Daten nicht gefunden werden, dann muessen bestimmte - // Attribute nachgebildet werden - FontInfo aInfo; + // reproduce attributes if data could not be found + vcl::FontInfo aInfo; if ( !pFontInfo ) aInfo = makeMissing(pFontNameInfo, rName, eWeight, eItalic); else @@ -724,9 +710,7 @@ sal_Bool FontList::IsAvailable(const OUString& rName) const return (ImplFindByName( rName ) != 0); } -// ----------------------------------------------------------------------- - -const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const +const vcl::FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const { DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" ); @@ -752,17 +736,13 @@ sal_Handle FontList::GetNextFontInfo( sal_Handle hFontInfo ) const return (sal_Handle)(pInfo->mpNext); } -// ----------------------------------------------------------------------- - -const FontInfo& FontList::GetFontInfo( sal_Handle hFontInfo ) const +const vcl::FontInfo& FontList::GetFontInfo( sal_Handle hFontInfo ) const { ImplFontListFontInfo* pInfo = (ImplFontListFontInfo*)(void*)hFontInfo; return *pInfo; } -// ----------------------------------------------------------------------- - -const sal_IntPtr* FontList::GetSizeAry( const FontInfo& rInfo ) const +const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const { // Size-Array vorher loeschen if ( mpSizeAry ) diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index f579dc2..d8a73f9 100644 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -157,9 +157,7 @@ void FontSizeMenu::Highlight() mnCurHeight = nTempHeight; } -// ----------------------------------------------------------------------- - -void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList ) +void FontSizeMenu::Fill( const vcl::FontInfo& rInfo, const FontList* pList ) { Clear(); diff --git a/svx/source/mnuctrls/fntszctl.cxx b/svx/source/mnuctrls/fntszctl.cxx index a5384b3..a77c7ac 100644 --- a/svx/source/mnuctrls/fntszctl.cxx +++ b/svx/source/mnuctrls/fntszctl.cxx @@ -123,7 +123,7 @@ void SvxFontSizeMenuControl::StateChanged( if ( pList ) { - FontInfo aFntInf = pList->Get( pItem->GetFamilyName(), + vcl::FontInfo aFntInf = pList->Get( pItem->GetFamilyName(), pItem->GetStyleName() ); pMenu->Fill( aFntInf, pList ); } diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 562ddf7..87b7f99 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1805,30 +1805,30 @@ sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uIn if( pLevelSettings->sBulletFont.getLength() && pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetName())) { - //search for the font - if(!pList) - { - SfxObjectShell* pCurDocShell = SfxObjectShell::Current(); - const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ); - pList = pFontListItem ? pFontListItem->GetFontList() : 0; - } - if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) - { - FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); + //search for the font + if(!pList) + { + SfxObjectShell* pCurDocShell = SfxObjectShell::Current(); + const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ); + pList = pFontListItem ? pFontListItem->GetFontList() : 0; + } + if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) + { + vcl::FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); - } - else - { - //if it cannot be found then create a new one - Font aCreateFont( pLevelSettings->sBulletFont, OUString(), Size( 0, 14 ) ); - aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW ); - aCreateFont.SetFamily( FAMILY_DONTKNOW ); - aCreateFont.SetPitch( PITCH_DONTKNOW ); - aCreateFont.SetWeight( WEIGHT_DONTKNOW ); - aCreateFont.SetTransparent( sal_True ); - aFmt.SetBulletFont( &aCreateFont ); - } + } + else + { + //if it cannot be found then create a new one + Font aCreateFont( pLevelSettings->sBulletFont, OUString(), Size( 0, 14 ) ); + aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW ); + aCreateFont.SetFamily( FAMILY_DONTKNOW ); + aCreateFont.SetPitch( PITCH_DONTKNOW ); + aCreateFont.SetWeight( WEIGHT_DONTKNOW ); + aCreateFont.SetTransparent( true ); + aFmt.SetBulletFont( &aCreateFont ); + } }else aFmt.SetBulletFont( &rActBulletFont ); diff --git a/svx/source/sidebar/text/SvxSBFontNameBox.cxx b/svx/source/sidebar/text/SvxSBFontNameBox.cxx index b94c613..66ba899 100644 --- a/svx/source/sidebar/text/SvxSBFontNameBox.cxx +++ b/svx/source/sidebar/text/SvxSBFontNameBox.cxx @@ -156,7 +156,7 @@ void SvxSBFontNameBox::Select() if ( !IsTravelSelect() ) { FillList(); - FontInfo aInfo( pFontList->Get( GetText(),WEIGHT_NORMAL, ITALIC_NORMAL ) );//meWeight, meItalic + vcl::FontInfo aInfo( pFontList->Get( GetText(),WEIGHT_NORMAL, ITALIC_NORMAL ) );//meWeight, meItalic SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetName(), aInfo.GetStyleName(), aInfo.GetPitch(), aInfo.GetCharSet(), SID_ATTR_CHAR_FONT ); diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index 0b8283e..6a18036 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -295,7 +295,7 @@ void TextPropertyPanel::Initialize (void) } mpFontNameBox->SetAccessibleName(mpFontNameBox->GetQuickHelpText()); - const FontInfo aFontInfo (mpFontList->Get( OUString( "" ), OUString( "" ))); + const vcl::FontInfo aFontInfo (mpFontList->Get( OUString( "" ), OUString( "" ))); mpFontSizeBox->Fill(&aFontInfo,mpFontList); mpFontSizeBox->SetAccessibleName(mpFontSizeBox->GetQuickHelpText()); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5621dc1..d5cdd4f 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -993,7 +993,7 @@ void SvxFontNameBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) if ( rUDEvt.GetItemId() == rUDEvt.GetStyle() ) { Sequence< PropertyValue > aArgs( 1 ); - FontInfo aInfo( pFontList->Get( GetEntry( rUDEvt.GetItemId() ), + vcl::FontInfo aInfo( pFontList->Get( GetEntry( rUDEvt.GetItemId() ), aCurFont.GetWeight(), aCurFont.GetItalic() ) ); @@ -1019,7 +1019,7 @@ void SvxFontNameBox_Impl::Select() std::auto_ptr<SvxFontItem> pFontItem; if ( pFontList ) { - FontInfo aInfo( pFontList->Get( GetText(), + vcl::FontInfo aInfo( pFontList->Get( GetText(), aCurFont.GetWeight(), aCurFont.GetItalic() ) ); aCurFont = aInfo; diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index ad99d66..8295a8a 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -167,7 +167,7 @@ void SvxFontSizeBox_Impl::UpdateFont( const ::com::sun::star::awt::FontDescripto if ( !rCurrentFont.Name.isEmpty() ) { - FontInfo _aFontInfo; + vcl::FontInfo _aFontInfo; _aFontInfo.SetName( rCurrentFont.Name ); _aFontInfo.SetStyleName( rCurrentFont.StyleName ); _aFontInfo.SetHeight( rCurrentFont.Height ); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 751648b..6e93b80 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -828,7 +828,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) ->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 41bbfeb..ffdeb7e 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1949,7 +1949,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex( (const SvxFontListItem* )pLclDocShell ->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( sBulletFontName, WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index f94adc6..4963b68 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1772,7 +1772,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, (const SvxFontListItem* )pDoc->GetDocShell() ->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get( + vcl::FontInfo aInfo = pList->Get( pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE); Font aFont(aInfo); aFmt.SetBulletFont(&aFont); diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 1619ee9..6c4eb6d 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -1107,7 +1107,7 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr, sal_Handle hFont = pFList->GetFirstFontInfo( aIdent ); if( 0 != hFont ) { - const FontInfo& rFInfo = pFList->GetFontInfo( hFont ); + const vcl::FontInfo& rFInfo = pFList->GetFontInfo( hFont ); if( RTL_TEXTENCODING_DONTKNOW != rFInfo.GetCharSet() ) { bFound = sal_True; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index fee5ef1..9778840 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3784,7 +3784,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) sal_Handle hFont = pFList->GetFirstFontInfo( aFName ); if( 0 != hFont ) { - const FontInfo& rFInfo = pFList->GetFontInfo( hFont ); + const vcl::FontInfo& rFInfo = pFList->GetFontInfo( hFont ); if( RTL_TEXTENCODING_DONTKNOW != rFInfo.GetCharSet() ) { bFound = sal_True; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index f5d3fb6..9ee2d35 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -795,7 +795,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) int nFontNames = pPrt->GetDevFontCount(); for( int i = 0; i < nFontNames; i++ ) { - FontInfo aInf( pPrt->GetDevFont( i ) ); + vcl::FontInfo aInf( pPrt->GetDevFont( i ) ); aFontNames.insert( aInf.GetName() ); } @@ -914,7 +914,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) pLabelBox->SetText(sCapBackup ); pIdxBox->SetText(sIdxBackup ); - FontInfo aFontInfo( pFontList->Get(sStdBackup, sStdBackup) ); + vcl::FontInfo aFontInfo( pFontList->Get(sStdBackup, sStdBackup) ); pStandardHeightLB->Fill( &aFontInfo, pFontList ); aFontInfo = pFontList->Get(sOutBackup, sOutBackup ); pTitleHeightLB->Fill( &aFontInfo, pFontList ); @@ -1055,7 +1055,7 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox ) { pHeightLB = pIndexHeightLB; } - FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) ); + vcl::FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) ); pHeightLB->Fill( &aFontInfo, pFontList ); return 0; } diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 97a7cc5..ec81ea6 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -185,7 +185,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, int nFontNames = pPrt->GetDevFontCount(); for( int i = 0; i < nFontNames; i++ ) { - FontInfo aInf( pPrt->GetDevFont( i ) ); + vcl::FontInfo aInf( pPrt->GetDevFont( i ) ); aFontNames.insert( aInf.GetName() ); } diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index d1b2ee7..918c80a 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -971,7 +971,7 @@ void SwSrcEditWindow::SetFont() const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); - FontInfo aInfo = pList->Get(sFontName,WEIGHT_NORMAL, ITALIC_NONE); + vcl::FontInfo aInfo = pList->Get(sFontName,WEIGHT_NORMAL, ITALIC_NONE); const Font& rFont = GetTextEngine()->GetFont(); Font aFont(aInfo); diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index d708ca2..2872ada 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -76,7 +76,7 @@ bool ImplFontMetric::operator==( const ImplFontMetric& r ) const return true; } -// ======================================================================= +namespace vcl { FontInfo::FontInfo() : mpImplMetric( new ImplFontMetric ) @@ -134,8 +134,10 @@ FontType FontInfo::GetType() const return (mpImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER); } -FontMetric::FontMetric( const FontMetric& rMetric ) -: FontInfo( rMetric ) +} + +FontMetric::FontMetric( const FontMetric& rMetric ): + vcl::FontInfo( rMetric ) {} // ----------------------------------------------------------------------- @@ -184,7 +186,7 @@ long FontMetric::GetSlant() const FontMetric& FontMetric::operator =( const FontMetric& rMetric ) { - FontInfo::operator=( rMetric ); + vcl::FontInfo::operator=( rMetric ); return *this; } @@ -192,7 +194,7 @@ FontMetric& FontMetric::operator =( const FontMetric& rMetric ) sal_Bool FontMetric::operator==( const FontMetric& rMetric ) const { - return FontInfo::operator==( rMetric ); + return vcl::FontInfo::operator==( rMetric ); } // ======================================================================= diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 52b13a0..b4fd044 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -247,7 +247,7 @@ void MyWin::Paint( const Rectangle& rRect ) for( int i = 0; i < nFontSamples; ++i ) { - FontInfo aFont = GetDevFont( (i*nFontCount) / nFontSamples ); + vcl::FontInfo aFont = GetDevFont( (i*nFontCount) / nFontSamples ); aFont.SetHeight( 400 + (i%7) * 100 ); aFont.SetOrientation( i * (3600 / nFontSamples) ); SetFont( aFont ); commit 191969ccaa65ee1e934cb3ebab9ef9a4aa3bcd5a Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Jun 10 06:30:09 2014 +0200 fix invalid memory access related to temporary object e.g. export of ooo116460-2.xlsx Change-Id: Id1ca2249e7b1f197a2df0d122c57dd97c4c4d785 diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 614a70a..847e61d 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -894,7 +894,8 @@ void XclExpAutofilter::SaveXml( XclExpXmlStream& rStrm ) std::vector<OUString>::const_iterator itr = maMultiValues.begin(), itrEnd = maMultiValues.end(); for (; itr != itrEnd; ++itr) { - const char* pz = OUStringToOString(*itr, RTL_TEXTENCODING_UTF8).getStr(); + OString aStr = OUStringToOString(*itr, RTL_TEXTENCODING_UTF8); + const char* pz = aStr.getStr(); rWorksheet->singleElement(XML_filter, XML_val, pz, FSEND); } rWorksheet->endElement(XML_filters); commit 4d7b2748d2a070572aa8c6cd6852b0b476dcfab1 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Jun 10 06:12:32 2014 +0200 don't use temporary object This avoids invalid memory access with fdo45268-1.xlsx Change-Id: If141df14d7d747023c944c83c2d8957abe8b95ad diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx b/sc/source/filter/inc/pivotcachebuffer.hxx index 484e25f..d1ab42e 100644 --- a/sc/source/filter/inc/pivotcachebuffer.hxx +++ b/sc/source/filter/inc/pivotcachebuffer.hxx @@ -289,7 +289,7 @@ public: /** Returns the names of all shared or group items. */ void getCacheItemNames( ::std::vector< OUString >& orItemNames ) const; /** Returns shared or group items. */ - PivotCacheItemList getCacheItems() const; + const PivotCacheItemList& getCacheItems() const; /** Creates inplace numeric grouping settings. */ void convertNumericGrouping( diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx index 8b3c155..d2cfdb6 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -769,7 +769,7 @@ void PivotCacheField::getCacheItemNames( ::std::vector< OUString >& orItemNames maSharedItems.getCacheItemNames( orItemNames ); } -PivotCacheItemList PivotCacheField::getCacheItems() const +const PivotCacheItemList& PivotCacheField::getCacheItems() const { if( hasGroupItems() ) return maGroupItems; commit 6afdb6860b307b71e8eb509d813538641339456a Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Sun Jun 8 06:13:40 2014 +0200 check for empty string before accessing first element E.g. fdo#64530-1.xlsx Change-Id: Iff2d026f6e876ab76c9b89b8200413d6c3a7a0e3 diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 7ebf959..bb31056 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -410,7 +410,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU msTarget = XclXmlUtils::ToOUString( aUrl ); } - else if( rUrl[0] == '#' ) // hack for #89066# + else if( !rUrl.isEmpty() && rUrl[0] == '#' ) // hack for #89066# { OUString aTextMark( rUrl.copy( 1 ) ); commit a70f0e271d90e0d0ad5a7897a5f3644ffd135a1d Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Wed Jun 4 04:09:34 2014 +0200 fix new[]/delete mismatch As seen by ooo90105-1.ods with memcheck Change-Id: Ib976632aa52556132b3d05ebb33e8fb64d8d9890 Conflicts: sc/source/filter/xml/xmldpimp.cxx diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 6ec52ef..d9d0ebb 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -1470,6 +1470,7 @@ ScXMLDataPilotSubTotalsContext::ScXMLDataPilotSubTotalsContext( ScXMLImport& rIm ScXMLDataPilotSubTotalsContext::~ScXMLDataPilotSubTotalsContext() { + delete[] pFunctions; } SvXMLImportContext *ScXMLDataPilotSubTotalsContext::CreateChildContext( sal_uInt16 nPrefix, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits