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 | 40 +++++++------- include/svtools/stdmenu.hxx | 6 +- include/vcl/metric.hxx | 14 ++--- include/vcl/outdev.hxx | 7 +- sc/source/core/data/column.cxx | 4 - 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/xcl97/XclExpChangeTrack.cxx | 3 - sc/source/filter/xml/xmldpimp.cxx | 2 starmath/source/dialog.cxx | 2 svtools/source/control/ctrlbox.cxx | 12 +--- svtools/source/control/ctrltool.cxx | 50 +++++------------- svtools/source/control/stdmenu.cxx | 4 - svx/source/mnuctrls/fntszctl.cxx | 2 svx/source/sidebar/nbdtmg.cxx | 44 +++++++-------- svx/source/tbxctrls/tbcontrl.cxx | 4 - svx/source/tbxctrls/tbunocontroller.cxx | 2 sw/source/core/uibase/docvw/srcedtw.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 vcl/source/gdi/metric.cxx | 12 ++-- vcl/source/outdev/font.cxx | 6 +- vcl/workben/svptest.cxx | 2 38 files changed, 133 insertions(+), 148 deletions(-)
New commits: commit 5ae32a6977207ca05c62186411a2f5e83b16d8f2 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 diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 1714256..3840a78 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -1471,7 +1471,7 @@ ScXMLDataPilotSubTotalsContext::ScXMLDataPilotSubTotalsContext( ScXMLImport& rIm ScXMLDataPilotSubTotalsContext::~ScXMLDataPilotSubTotalsContext() { - delete pFunctions; + delete[] pFunctions; } SvXMLImportContext *ScXMLDataPilotSubTotalsContext::CreateChildContext( sal_uInt16 nPrefix, commit 0245bda7c3850171ce68ec61dbe6745e32b8f4a2 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 c452edf..d937b59 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -34,9 +34,10 @@ namespace vcl { // avoid problems where poppler's FontInfo is picked up class VCL_DLLPUBLIC FontInfo : public Font { - friend class OutputDevice; + friend class ::OutputDevice; protected: + ImplFontMetric* mpImplMetric; // Implementation public: FontInfo(); @@ -49,7 +50,6 @@ public: bool operator==( const FontInfo& ) const; bool operator!=( const FontInfo& rInfo ) const { return !operator==( rInfo ); } - ImplFontMetric* mpImplMetric; // Implementation }; } commit 2980f4986d1349cb83b13794d60c85950b3b9d6d 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 diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 868c6e1..efe9f71 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 f36ae8e..85e6d76 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()); bool bFontAvailable = _pFontList->IsAvailable( sFontName ); if (bFontAvailable || _pFontNameLB->IsValueChangedFromSaved()) @@ -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 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp sal_Int32 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 7091120..c57db72 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -710,7 +710,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 b363d1f..9721217 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1184,7 +1184,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 d530931..63cb6ad 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -152,7 +152,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r if ( !pFontList ) pFontList.reset(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 78986bd..c068285 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -37,7 +37,7 @@ class ImpLineListData; typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImpLineListData* > ImpLineList; -typedef ::std::vector< FontInfo > ImplFontList; +typedef ::std::vector< vcl::FontInfo > ImplFontList; #define CHANGE_LINE1 ( ( sal_uInt16 ) 1 ) #define CHANGE_LINE2 ( ( sal_uInt16 ) 2 ) @@ -480,7 +480,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; @@ -506,7 +506,7 @@ public: void Reformat() SAL_OVERRIDE; void Modify() SAL_OVERRIDE; - 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 39e248f..a5d6077 100644 --- a/include/svtools/ctrltool.hxx +++ b/include/svtools/ctrltool.hxx @@ -71,28 +71,28 @@ With sal_False vectorized and scalable fonts will be queried. -------------------------------------------------------------------------- -String FontList::GetStyleName( const FontInfo& rInfo ) const; +String FontList::GetStyleName( const vcl::FontInfo& rInfo ) const; -This method returns the StyleName of a FontInfo. +This method returns the StyleName of a vcl::FontInfo. If no StyleName is set, a name will be generated from the set attributes. -------------------------------------------------------------------------- -OUString FontList::GetFontMapText( const FontInfo& rInfo ) const; +OUString FontList::GetFontMapText( const vcl::FontInfo& rInfo ) const; This method returns a Matchstring which indicates the problem that could arise when using a font. This string should be displayed to the user. -------------------------------------------------------------------------- -FontInfo FontList::Get( const String& rName, const String& rStyleName ) const; +vcl::FontInfo FontList::Get( const String& rName, const String& rStyleName ) const; -This method search a FontInfo for the given name and the given style name. +This method search a vcl::FontInfo for the given name and the given style name. The Stylename can also be a synthetic one. -In that case the relevant FontInfo fields will be set. -If a StyleName is provived, a FontInfo structure without a Stylename can be +In that case the relevant vcl::FontInfo fields will be set. +If a StyleName is provived, a vcl::FontInfo structure without a Stylename can be returned. To get a representation of the StyleName for displaying it to the user, -call GetStyleName() on this FontInfo structure. +call GetStyleName() on this vcl::FontInfo structure. Links: @@ -100,13 +100,13 @@ FontList::GetStyleName() -------------------------------------------------------------------------- -FontInfo FontList::Get( const String& rName, FontWeight eWeight, +vcl::FontInfo FontList::Get( const String& rName, FontWeight eWeight, FontItalic eItalic ) const; -This method search a FontInfo structure for a provided name and styles. -This method can also return a FontInfo without a Stylename. +This method search a vcl::FontInfo structure for a provided name and styles. +This method can also return a vcl::FontInfo without a Stylename. To get a representation of the StyleName to be presented to the user -call GetStyleName() with this FontInfo. +call GetStyleName() with this vcl::FontInfo. Links: @@ -114,7 +114,7 @@ FontList::GetStyleName() -------------------------------------------------------------------------- -const sal_IntPtr* FontList::GetSizeAry( const FontInfo& rInfo ) const; +const sal_IntPtr* FontList::GetSizeAry( const vcl::FontInfo& rInfo ) const; This method returns the available sizes for the given font. If it is a scalable font, standard sizes are returned. @@ -168,18 +168,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; @@ -188,12 +188,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 78062fd..0b7b7f2 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() SAL_OVERRIDE; virtual void Highlight() SAL_OVERRIDE; - 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 8e0957a..c452edf 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -22,22 +22,21 @@ #include <vcl/dllapi.h> #include <vcl/font.hxx> +#include <vcl/outdev.hxx> class ImplFontMetric; class ImplFontCharMap; typedef sal_uInt32 sal_UCS4; +namespace vcl { -// - FontInfo - - - +// avoid problems where poppler's FontInfo is picked up class VCL_DLLPUBLIC FontInfo : public Font { friend class OutputDevice; protected: - ImplFontMetric* mpImplMetric; // Implementation public: FontInfo(); @@ -50,13 +49,12 @@ public: bool operator==( const FontInfo& ) const; 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 0c18525..25bf4cf 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -83,7 +83,6 @@ class BitmapReadAccess; class BitmapEx; class Image; class TextRectInfo; -class FontInfo; class FontMetric; class GDIMetaFile; class GfxLink; @@ -232,6 +231,10 @@ class FontSelectPattern; class ImplFontMetricData; class VCLXGraphics; +namespace vcl { + class FontInfo; +} + typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl; sal_uLong AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix ); @@ -1069,7 +1072,7 @@ private: public: - FontInfo GetDevFont( int nDevFontIndex ) const; + vcl::FontInfo GetDevFont( int nDevFontIndex ) const; int GetDevFontCount() const; bool IsFontAvailable( const OUString& rFontName ) const; diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index b59c987..add62f7 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -740,7 +740,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 59ce92e..6fc2651 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 6e9dfde..c329140 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2268,7 +2268,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 3bd3eba..d54dcb4 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1148,7 +1148,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 ) { @@ -1228,13 +1228,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(); @@ -1525,7 +1523,7 @@ void FontStyleBox::Fill( const OUString& rName, const FontList* pList ) bool bBold = false; bool bBoldItalic = false; bool bInsert = false; - FontInfo aInfo; + vcl::FontInfo aInfo; while ( hFontInfo ) { aInfo = pList->GetFontInfo( hFontInfo ); @@ -1761,9 +1759,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 4818928..e973e63 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -69,13 +69,7 @@ static const sal_IntPtr aStdSizeAry[] = 0 }; - - - -// - class ImplFontListFonInfo - - - -class ImplFontListFontInfo : public FontInfo +class ImplFontListFontInfo : public vcl::FontInfo { friend class FontList; @@ -84,9 +78,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; } @@ -259,7 +253,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll, sal_uInt16 i; for( i = 0; i < n; i++ ) { - FontInfo aFontInfo = pDevice->GetDevFont( i ); + vcl::FontInfo aFontInfo = pDevice->GetDevFont( i ); // ignore raster-fonts if they are not to be displayed if ( !bAll && (aFontInfo.GetType() == TYPE_RASTER) ) @@ -307,7 +301,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, 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(); @@ -495,9 +487,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() ) { @@ -567,10 +557,10 @@ 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; + vcl::FontInfo aInfo; // if the fontname matches, we copy as much as possible if (pFontNameInfo) { @@ -590,7 +580,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; @@ -613,7 +603,7 @@ FontInfo FontList::Get(const OUString& rName, const OUString& rStyleName) const } // reproduce attributes if data could not be found - FontInfo aInfo; + vcl::FontInfo aInfo; if ( !pFontInfo ) { FontWeight eWeight = WEIGHT_DONTKNOW; @@ -671,9 +661,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 ); @@ -697,7 +685,7 @@ FontInfo FontList::Get(const OUString& rName, } // reproduce attributes if data could not be found - FontInfo aInfo; + vcl::FontInfo aInfo; if ( !pFontInfo ) aInfo = makeMissing(pFontNameInfo, rName, eWeight, eItalic); else @@ -716,9 +704,7 @@ 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" ); @@ -744,17 +730,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 { // first delete Size-Array if ( mpSizeAry ) diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index af3546a..b07e81b 100644 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -161,9 +161,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 a5a9c09..2ec67f0 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 d052708..c2fbe6c 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1771,30 +1771,30 @@ bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 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( 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/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index d1771f2..bf18eca 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -994,7 +994,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() ) ); @@ -1020,7 +1020,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 3b3a9b0..02f7da9 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -207,7 +207,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/uibase/docvw/srcedtw.cxx b/sw/source/core/uibase/docvw/srcedtw.cxx index 3537809..5ad3760 100644 --- a/sw/source/core/uibase/docvw/srcedtw.cxx +++ b/sw/source/core/uibase/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/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 292f6d1..683f2e2 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -827,7 +827,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 958f510..bf1a11b 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1936,7 +1936,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 5359ada..15a4639 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1887,7 +1887,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 c1d3db5..6882622 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -1097,7 +1097,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 = true; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 2fb457c..0e77bf0 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3771,7 +3771,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 = true; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 097e31a..a096350 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -794,7 +794,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() ); } @@ -912,7 +912,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 ); @@ -1053,7 +1053,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 f211495..8288700 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -189,7 +189,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/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index f4b786c..5ed467e 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -67,6 +67,8 @@ bool ImplFontMetric::operator==( const ImplFontMetric& r ) const return true; } +namespace vcl { + FontInfo::FontInfo() : mpImplMetric( new ImplFontMetric ) {} @@ -113,8 +115,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 ) {} long FontMetric::GetAscent() const @@ -149,13 +153,13 @@ long FontMetric::GetSlant() const FontMetric& FontMetric::operator =( const FontMetric& rMetric ) { - FontInfo::operator=( rMetric ); + vcl::FontInfo::operator=( rMetric ); return *this; } bool FontMetric::operator==( const FontMetric& rMetric ) const { - return FontInfo::operator==( rMetric ); + return vcl::FontInfo::operator==( rMetric ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 6de4765..7104caa 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -58,12 +58,12 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::rtl; -using namespace ::vcl; using namespace ::utl; +using namespace ::vcl; -FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const +vcl::FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const { - FontInfo aFontInfo; + vcl::FontInfo aFontInfo; ImplInitFontList(); diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 8ba8277..84466ad 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -241,7 +241,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 c1f99af92612b9b59553206cca786649f2e7b3cc Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Sat Jun 7 04:46:39 2014 +0200 column storage might be changed, related lp#990868 Change-Id: Ibd196484c8c5199e7398726a250082c266a89229 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 7d6ebb1..f0dc03a 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1709,7 +1709,6 @@ void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) { // This is the scenario table, the data is copied into it - sc::CopyToDocContext aCxt(*pDocument); ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW ); SCROW nStart = -1, nEnd = -1; const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd ); @@ -1718,6 +1717,7 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) if ( ((ScMergeFlagAttr&)pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() ) { DeleteArea( nStart, nEnd, IDF_CONTENTS ); + sc::CopyToDocContext aCxt(*pDocument); ((ScColumn&)rSrcCol). CopyToColumn(aCxt, nStart, nEnd, IDF_CONTENTS, false, *this); @@ -1741,7 +1741,6 @@ void ScColumn::CopyScenarioFrom( const ScColumn& rSrcCol ) void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const { // This is the scenario table, the data is copied to the other - sc::CopyToDocContext aCxt(*rDestCol.pDocument); ScAttrIterator aAttrIter( pAttrArray, 0, MAXROW ); SCROW nStart = -1, nEnd = -1; const ScPatternAttr* pPattern = aAttrIter.Next( nStart, nEnd ); @@ -1750,6 +1749,7 @@ void ScColumn::CopyScenarioTo( ScColumn& rDestCol ) const if ( ((ScMergeFlagAttr&)pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() ) { rDestCol.DeleteArea( nStart, nEnd, IDF_CONTENTS ); + sc::CopyToDocContext aCxt(*rDestCol.pDocument); CopyToColumn(aCxt, nStart, nEnd, IDF_CONTENTS, false, rDestCol); // UpdateUsed not needed, is already done in TestCopyScenario (obsolete comment ?) commit 004964569e88838e768bf2a04857122b49b7c8e3 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 af726b2..ab47be4d 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -404,7 +404,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 0d580b110663037518b01545b8c37c1518a50800 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Sun Jun 8 07:05:20 2014 +0200 workaround for DBG_UTIL XML correctness checks The current check will always be hit as the StartXmlElement does not use a call that puts the element on the stack. So copy the pattern for the EndXmlElement class. However we should work on getting rid of these ugly hacks. Change-Id: Id1141f4afc78a0cae1e4b7accae76e6ae08b77a7 diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index ae8fb1d..8eef7b7 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1338,7 +1338,8 @@ public: void EndXmlElement::SaveXml( XclExpXmlStream& rStrm ) { - rStrm.GetCurrentStream()->endElement( mnElement ); + sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream(); + pStream->write("</")->writeId(mnElement)->write(">"); } class EndHeaderElement : public EndXmlElement commit fac0ea95275d331e719317fa84886c16776cd0eb 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 ffac9cf..a4e0746 100644 --- a/sc/source/filter/inc/pivotcachebuffer.hxx +++ b/sc/source/filter/inc/pivotcachebuffer.hxx @@ -275,7 +275,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 7ece914..b9a491f 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -749,7 +749,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 f60d6fb716c5ae0590f3efe3407ab7c5475ede32 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 b7ce324..36a3254 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -891,7 +891,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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits