Kaydet (Commit) 6e32cf8b authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: memory leak

Change-Id: Ida561d59f5fbd2b4dff5d0ef355a21a344a2afd2
Reviewed-on: https://gerrit.libreoffice.org/50808Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 0c8e2d20
...@@ -124,7 +124,7 @@ public: ...@@ -124,7 +124,7 @@ public:
/** /**
* descr: set cell background image. * descr: set cell background image.
*/ */
void SetBackImage(XFBGImage *pImage); void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
virtual enumXFStyle GetStyleFamily() override; virtual enumXFStyle GetStyleFamily() override;
...@@ -139,7 +139,7 @@ private: ...@@ -139,7 +139,7 @@ private:
double m_fTextIndent; double m_fTextIndent;
XFColor m_aBackColor; XFColor m_aBackColor;
XFBGImage *m_pBackImage; std::unique_ptr<XFBGImage> m_xBackImage;
XFMargins m_aMargin; XFMargins m_aMargin;
XFPadding m_aPadding; XFPadding m_aPadding;
rtl::Reference<XFFont> m_pFont; rtl::Reference<XFFont> m_pFont;
......
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
/** /**
* @descr: set the background image of the frame. * @descr: set the background image of the frame.
*/ */
void SetBackImage(XFBGImage *iamge); void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
/** /**
* @descr: set the background color of the frame. * @descr: set the background color of the frame.
......
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
*/ */
void SetBorders(XFBorders *pBorders); void SetBorders(XFBorders *pBorders);
void SetBackImage(XFBGImage *image); void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
/** /**
* @descr Set header background color. * @descr Set header background color.
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
void SetBackColor(XFColor color); void SetBackColor(XFColor color);
void SetBackImage(XFBGImage *image); void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
void SetColumns(XFColumns *pColumns); void SetColumns(XFColumns *pColumns);
......
...@@ -190,7 +190,7 @@ public: ...@@ -190,7 +190,7 @@ public:
* @descr Set background image of the paragraph. * @descr Set background image of the paragraph.
* @param image the background image to set. * @param image the background image to set.
*/ */
void SetBackImage(XFBGImage *image); void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
/** /**
* descr You can only set one break property for every para style object. * descr You can only set one break property for every para style object.
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
void SetBackColor(XFColor const & color); void SetBackColor(XFColor const & color);
void SetBackImage(XFBGImage *pImage); void SetBackImage(std::unique_ptr<XFBGImage>& rImage);
virtual void ToXml(IXFStream *pStrm) override; virtual void ToXml(IXFStream *pStrm) override;
......
...@@ -101,12 +101,12 @@ LwpColor* LwpBackgroundStuff::GetFillColor() ...@@ -101,12 +101,12 @@ LwpColor* LwpBackgroundStuff::GetFillColor()
return &m_aFillColor; return &m_aFillColor;
} }
XFBGImage* LwpBackgroundStuff::GetFillPattern() std::unique_ptr<XFBGImage> LwpBackgroundStuff::GetFillPattern()
{ {
// not pattern fill? // not pattern fill?
if (!IsPatternFill()) if (!IsPatternFill())
{ {
return nullptr; return std::unique_ptr<XFBGImage>();
} }
// get pattern array from pattern table // get pattern array from pattern table
...@@ -151,15 +151,15 @@ XFBGImage* LwpBackgroundStuff::GetFillPattern() ...@@ -151,15 +151,15 @@ XFBGImage* LwpBackgroundStuff::GetFillPattern()
memcpy(pImageBuff, aPicMemStream.GetData(), nSize); memcpy(pImageBuff, aPicMemStream.GetData(), nSize);
// create XFBGImage object. // create XFBGImage object.
XFBGImage* pXFBGImage = new XFBGImage(); std::unique_ptr<XFBGImage> xXFBGImage(new XFBGImage);
pXFBGImage->SetImageData(pImageBuff, nSize); xXFBGImage->SetImageData(pImageBuff, nSize);
delete [] pImageBuff; delete [] pImageBuff;
pImageBuff = nullptr; pImageBuff = nullptr;
pXFBGImage->SetRepeate(); xXFBGImage->SetRepeate();
return pXFBGImage; return xXFBGImage;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -150,7 +150,7 @@ private: ...@@ -150,7 +150,7 @@ private:
public: public:
void Read(LwpObjectStream *pStrm); void Read(LwpObjectStream *pStrm);
LwpColor* GetFillColor(); LwpColor* GetFillColor();
XFBGImage* GetFillPattern(); std::unique_ptr<XFBGImage> GetFillPattern();
bool IsTransparent() { return (m_nID == BACK_TRANSPARENT); } bool IsTransparent() { return (m_nID == BACK_TRANSPARENT); }
bool IsPatternFill() { return (m_nID > 2 && m_nID < 72); } bool IsPatternFill() { return (m_nID > 2 && m_nID < 72); }
......
...@@ -209,10 +209,10 @@ void LwpCellLayout::ApplyBorders(XFCellStyle *pCellStyle) ...@@ -209,10 +209,10 @@ void LwpCellLayout::ApplyBorders(XFCellStyle *pCellStyle)
*/ */
void LwpCellLayout::ApplyWatermark(XFCellStyle *pCellStyle) void LwpCellLayout::ApplyWatermark(XFCellStyle *pCellStyle)
{ {
XFBGImage* pBGImage = GetXFBGImage(); std::unique_ptr<XFBGImage> xBGImage(GetXFBGImage());
if(pBGImage) if (xBGImage)
{ {
pCellStyle->SetBackImage(pBGImage); pCellStyle->SetBackImage(xBGImage);
} }
} }
...@@ -223,10 +223,10 @@ void LwpCellLayout::ApplyWatermark(XFCellStyle *pCellStyle) ...@@ -223,10 +223,10 @@ void LwpCellLayout::ApplyWatermark(XFCellStyle *pCellStyle)
*/ */
void LwpCellLayout::ApplyPatternFill(XFCellStyle* pCellStyle) void LwpCellLayout::ApplyPatternFill(XFCellStyle* pCellStyle)
{ {
XFBGImage* pXFBGImage = GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(GetFillPattern());
if (pXFBGImage) if (xXFBGImage)
{ {
pCellStyle->SetBackImage(pXFBGImage); pCellStyle->SetBackImage(xXFBGImage);
} }
} }
......
...@@ -531,10 +531,10 @@ void LwpFrame::ApplyPosType(XFFrameStyle* pFrameStyle) ...@@ -531,10 +531,10 @@ void LwpFrame::ApplyPosType(XFFrameStyle* pFrameStyle)
*/ */
void LwpFrame::ApplyWatermark(XFFrameStyle *pFrameStyle) void LwpFrame::ApplyWatermark(XFFrameStyle *pFrameStyle)
{ {
XFBGImage* pBGImage = m_pLayout->GetXFBGImage(); std::unique_ptr<XFBGImage> xBGImage(m_pLayout->GetXFBGImage());
if(pBGImage) if (xBGImage)
{ {
pFrameStyle->SetBackImage(pBGImage); pFrameStyle->SetBackImage(xBGImage);
//set watermark transparent //set watermark transparent
rtl::Reference<LwpVirtualLayout> xWaterMarkLayout(m_pLayout->GetWaterMarkLayout()); rtl::Reference<LwpVirtualLayout> xWaterMarkLayout(m_pLayout->GetWaterMarkLayout());
LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xWaterMarkLayout.get()); LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xWaterMarkLayout.get());
...@@ -553,10 +553,10 @@ void LwpFrame::ApplyWatermark(XFFrameStyle *pFrameStyle) ...@@ -553,10 +553,10 @@ void LwpFrame::ApplyWatermark(XFFrameStyle *pFrameStyle)
*/ */
void LwpFrame::ApplyPatternFill(XFFrameStyle* pFrameStyle) void LwpFrame::ApplyPatternFill(XFFrameStyle* pFrameStyle)
{ {
XFBGImage* pXFBGImage = m_pLayout->GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(m_pLayout->GetFillPattern());
if (pXFBGImage) if (xXFBGImage)
{ {
pFrameStyle->SetBackImage(pXFBGImage); pFrameStyle->SetBackImage(xXFBGImage);
} }
} }
......
...@@ -1100,7 +1100,7 @@ bool LwpMiddleLayout::IsPatternFill() ...@@ -1100,7 +1100,7 @@ bool LwpMiddleLayout::IsPatternFill()
* @descr: Get the fill pattern style. Data are saved in a XFBGImage object * @descr: Get the fill pattern style. Data are saved in a XFBGImage object
* @return: the fill pattern style. * @return: the fill pattern style.
*/ */
XFBGImage* LwpMiddleLayout::GetFillPattern() std::unique_ptr<XFBGImage> LwpMiddleLayout::GetFillPattern()
{ {
LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff(); LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
if (pBackgroundStuff) if (pBackgroundStuff)
...@@ -1108,8 +1108,7 @@ XFBGImage* LwpMiddleLayout::GetFillPattern() ...@@ -1108,8 +1108,7 @@ XFBGImage* LwpMiddleLayout::GetFillPattern()
return pBackgroundStuff->GetFillPattern(); return pBackgroundStuff->GetFillPattern();
} }
return nullptr; return std::unique_ptr<XFBGImage>();
} }
/** /**
...@@ -1360,8 +1359,10 @@ rtl::Reference<LwpVirtualLayout> LwpMiddleLayout::GetWaterMarkLayout() ...@@ -1360,8 +1359,10 @@ rtl::Reference<LwpVirtualLayout> LwpMiddleLayout::GetWaterMarkLayout()
* @descr: Create and reture xfbgimage object for watermark * @descr: Create and reture xfbgimage object for watermark
* *
*/ */
XFBGImage* LwpMiddleLayout::GetXFBGImage() std::unique_ptr<XFBGImage> LwpMiddleLayout::GetXFBGImage()
{ {
std::unique_ptr<XFBGImage> xXFBGImage;
rtl::Reference<LwpVirtualLayout> xWaterMarkLayout(GetWaterMarkLayout()); rtl::Reference<LwpVirtualLayout> xWaterMarkLayout(GetWaterMarkLayout());
LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xWaterMarkLayout.get()); LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xWaterMarkLayout.get());
if(pLay) if(pLay)
...@@ -1370,8 +1371,7 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage() ...@@ -1370,8 +1371,7 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage()
LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent().obj().get()); LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent().obj().get());
if(pGrfObj) if(pGrfObj)
{ {
std::unique_ptr<XFBGImage> xXFBGImage(new XFBGImage); xXFBGImage.reset(new XFBGImage);
if(pGrfObj->IsLinked()) if(pGrfObj->IsLinked())
{ {
//set file link //set file link
...@@ -1405,10 +1405,9 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage() ...@@ -1405,10 +1405,9 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage()
xXFBGImage->SetStretch(); xXFBGImage->SetStretch();
} }
} }
return xXFBGImage.release();
} }
} }
return nullptr; return xXFBGImage;
} }
/** /**
......
...@@ -360,7 +360,7 @@ public: ...@@ -360,7 +360,7 @@ public:
virtual bool HonorProtection() override; virtual bool HonorProtection() override;
virtual bool IsProtected() override; virtual bool IsProtected() override;
rtl::Reference<LwpVirtualLayout> GetWaterMarkLayout(); rtl::Reference<LwpVirtualLayout> GetWaterMarkLayout();
XFBGImage* GetXFBGImage(); std::unique_ptr<XFBGImage> GetXFBGImage();
bool GetUsePrinterSettings(); bool GetUsePrinterSettings();
LwpLayoutScale* GetLayoutScale(){return dynamic_cast<LwpLayoutScale*>(m_LayScale.obj().get());} LwpLayoutScale* GetLayoutScale(){return dynamic_cast<LwpLayoutScale*>(m_LayScale.obj().get());}
...@@ -378,7 +378,7 @@ public: ...@@ -378,7 +378,7 @@ public:
LwpPoint GetOrigin(); LwpPoint GetOrigin();
bool IsPatternFill(); bool IsPatternFill();
XFBGImage* GetFillPattern(); std::unique_ptr<XFBGImage> GetFillPattern();
//Check whether there are contents in the layout //Check whether there are contents in the layout
virtual bool HasContent() override; virtual bool HasContent() override;
......
...@@ -162,10 +162,10 @@ void LwpPageLayout::ParseGeometry(XFPageMaster* pm1) ...@@ -162,10 +162,10 @@ void LwpPageLayout::ParseGeometry(XFPageMaster* pm1)
*/ */
void LwpPageLayout::ParseWaterMark(XFPageMaster *pm1) void LwpPageLayout::ParseWaterMark(XFPageMaster *pm1)
{ {
XFBGImage* pXFBGImage = GetXFBGImage(); std::unique_ptr<XFBGImage> xXFBGImage(GetXFBGImage());
if(pXFBGImage) if (xXFBGImage)
{ {
pm1->SetBackImage(pXFBGImage); pm1->SetBackImage(xXFBGImage);
} }
} }
...@@ -214,10 +214,10 @@ void LwpPageLayout::ParseShadow(XFPageMaster *pm1) ...@@ -214,10 +214,10 @@ void LwpPageLayout::ParseShadow(XFPageMaster *pm1)
*/ */
void LwpPageLayout::ParsePatternFill(XFPageMaster* pm1) void LwpPageLayout::ParsePatternFill(XFPageMaster* pm1)
{ {
XFBGImage* pXFBGImage = GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(GetFillPattern());
if (pXFBGImage) if (xXFBGImage)
{ {
pm1->SetBackImage(pXFBGImage); pm1->SetBackImage(xXFBGImage);
} }
} }
/** /**
...@@ -834,10 +834,10 @@ void LwpHeaderLayout::ParseShadow(XFHeaderStyle* pHeaderStyle) ...@@ -834,10 +834,10 @@ void LwpHeaderLayout::ParseShadow(XFHeaderStyle* pHeaderStyle)
*/ */
void LwpHeaderLayout::ParsePatternFill(XFHeaderStyle* pHeaderStyle) void LwpHeaderLayout::ParsePatternFill(XFHeaderStyle* pHeaderStyle)
{ {
XFBGImage* pXFBGImage = GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(GetFillPattern());
if (pXFBGImage) if (xXFBGImage)
{ {
pHeaderStyle->SetBackImage(pXFBGImage); pHeaderStyle->SetBackImage(xXFBGImage);
} }
} }
/** /**
...@@ -867,10 +867,10 @@ void LwpHeaderLayout::ParseBackColor(XFHeaderStyle* pHeaderStyle) ...@@ -867,10 +867,10 @@ void LwpHeaderLayout::ParseBackColor(XFHeaderStyle* pHeaderStyle)
void LwpHeaderLayout::ParseWaterMark(XFHeaderStyle * pHeaderStyle) void LwpHeaderLayout::ParseWaterMark(XFHeaderStyle * pHeaderStyle)
{ {
XFBGImage* pXFBGImage = GetXFBGImage(); std::unique_ptr<XFBGImage> xXFBGImage(GetXFBGImage());
if(pXFBGImage) if (xXFBGImage)
{ {
pHeaderStyle->SetBackImage(pXFBGImage); pHeaderStyle->SetBackImage(xXFBGImage);
} }
} }
//End by //End by
...@@ -995,10 +995,10 @@ void LwpFooterLayout::ParseShadow(XFFooterStyle* pFooterStyle) ...@@ -995,10 +995,10 @@ void LwpFooterLayout::ParseShadow(XFFooterStyle* pFooterStyle)
*/ */
void LwpFooterLayout::ParsePatternFill(XFFooterStyle* pFooterStyle) void LwpFooterLayout::ParsePatternFill(XFFooterStyle* pFooterStyle)
{ {
XFBGImage* pXFBGImage = GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(GetFillPattern());
if (pXFBGImage) if (xXFBGImage)
{ {
pFooterStyle->SetBackImage(pXFBGImage); pFooterStyle->SetBackImage(xXFBGImage);
} }
} }
/** /**
...@@ -1053,10 +1053,10 @@ void LwpFooterLayout::RegisterStyle(XFMasterPage* mp1) ...@@ -1053,10 +1053,10 @@ void LwpFooterLayout::RegisterStyle(XFMasterPage* mp1)
void LwpFooterLayout::ParseWaterMark(XFFooterStyle * pFooterStyle) void LwpFooterLayout::ParseWaterMark(XFFooterStyle * pFooterStyle)
{ {
XFBGImage* pXFBGImage = GetXFBGImage(); std::unique_ptr<XFBGImage> xXFBGImage(GetXFBGImage());
if(pXFBGImage) if (xXFBGImage)
{ {
pFooterStyle->SetBackImage(pXFBGImage); pFooterStyle->SetBackImage(xXFBGImage);
} }
} }
......
...@@ -409,8 +409,8 @@ void LwpPara::RegisterStyle() ...@@ -409,8 +409,8 @@ void LwpPara::RegisterStyle()
{ {
if (rBGStuff.IsPatternFill()) if (rBGStuff.IsPatternFill())
{ {
XFBGImage* pXFBGImage = rBGStuff.GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(rBGStuff.GetFillPattern());
xOverStyle->SetBackImage(pXFBGImage); xOverStyle->SetBackImage(xXFBGImage);
} }
else else
{ {
......
...@@ -277,10 +277,10 @@ void LwpSuperTableLayout::ApplyShadow(XFTableStyle *pTableStyle) ...@@ -277,10 +277,10 @@ void LwpSuperTableLayout::ApplyShadow(XFTableStyle *pTableStyle)
*/ */
void LwpSuperTableLayout::ApplyPatternFill(XFTableStyle* pTableStyle) void LwpSuperTableLayout::ApplyPatternFill(XFTableStyle* pTableStyle)
{ {
XFBGImage* pXFBGImage = GetFillPattern(); std::unique_ptr<XFBGImage> xXFBGImage(GetFillPattern());
if (pXFBGImage) if (xXFBGImage)
{ {
pTableStyle->SetBackImage(pXFBGImage); pTableStyle->SetBackImage(xXFBGImage);
} }
} }
...@@ -321,10 +321,10 @@ void LwpSuperTableLayout::ApplyBackColor(XFTableStyle *pTableStyle) ...@@ -321,10 +321,10 @@ void LwpSuperTableLayout::ApplyBackColor(XFTableStyle *pTableStyle)
*/ */
void LwpSuperTableLayout::ApplyWatermark(XFTableStyle *pTableStyle) void LwpSuperTableLayout::ApplyWatermark(XFTableStyle *pTableStyle)
{ {
XFBGImage* pBGImage = GetXFBGImage(); std::unique_ptr<XFBGImage> xBGImage(GetXFBGImage());
if(pBGImage) if (xBGImage)
{ {
pTableStyle->SetBackImage(pBGImage); pTableStyle->SetBackImage(xBGImage);
} }
} }
/** /**
......
...@@ -66,7 +66,6 @@ XFCellStyle::XFCellStyle() ...@@ -66,7 +66,6 @@ XFCellStyle::XFCellStyle()
: m_eHoriAlign(enumXFAlignNone) : m_eHoriAlign(enumXFAlignNone)
, m_eVertAlign(enumXFAlignNone) , m_eVertAlign(enumXFAlignNone)
, m_fTextIndent(0) , m_fTextIndent(0)
, m_pBackImage(nullptr)
, m_pBorders(nullptr) , m_pBorders(nullptr)
, m_bWrapText(false) , m_bWrapText(false)
{} {}
...@@ -92,10 +91,9 @@ void XFCellStyle::SetBackColor(XFColor const & color) ...@@ -92,10 +91,9 @@ void XFCellStyle::SetBackColor(XFColor const & color)
m_aBackColor = color; m_aBackColor = color;
} }
void XFCellStyle::SetBackImage(XFBGImage *pImage) void XFCellStyle::SetBackImage(std::unique_ptr<XFBGImage>& rImage)
{ {
delete m_pBackImage; m_xBackImage = std::move(rImage);
m_pBackImage = pImage;
} }
void XFCellStyle::SetBorders(XFBorders *pBorders) void XFCellStyle::SetBorders(XFBorders *pBorders)
...@@ -175,16 +173,16 @@ bool XFCellStyle::Equal(IXFStyle *pStyle) ...@@ -175,16 +173,16 @@ bool XFCellStyle::Equal(IXFStyle *pStyle)
return false; return false;
//if there is backimage //if there is backimage
if( m_pBackImage ) if (m_xBackImage)
{ {
if( !pOther->m_pBackImage ) if( !pOther->m_xBackImage )
return false; return false;
if( !m_pBackImage->Equal(pOther) ) if( !m_xBackImage->Equal(pOther) )
return false; return false;
} }
else else
{ {
if( pOther->m_pBackImage ) if( pOther->m_xBackImage )
return false; return false;
} }
...@@ -243,7 +241,7 @@ void XFCellStyle::ToXml(IXFStream *pStrm) ...@@ -243,7 +241,7 @@ void XFCellStyle::ToXml(IXFStream *pStrm)
m_pBorders->ToXml(pStrm); m_pBorders->ToXml(pStrm);
//background color: //background color:
if( m_aBackColor.IsValid() && !m_pBackImage ) if( m_aBackColor.IsValid() && !m_xBackImage )
{ {
pAttrList->AddAttribute("fo:background-color", m_aBackColor.ToString() ); pAttrList->AddAttribute("fo:background-color", m_aBackColor.ToString() );
} }
...@@ -253,8 +251,8 @@ void XFCellStyle::ToXml(IXFStream *pStrm) ...@@ -253,8 +251,8 @@ void XFCellStyle::ToXml(IXFStream *pStrm)
pStrm->StartElement("style:properties"); pStrm->StartElement("style:properties");
if( m_pBackImage ) if( m_xBackImage )
m_pBackImage->ToXml(pStrm); m_xBackImage->ToXml(pStrm);
pStrm->EndElement("style:properties"); pStrm->EndElement("style:properties");
......
...@@ -95,9 +95,9 @@ void XFFrameStyle::SetShadow(XFShadow *pShadow) ...@@ -95,9 +95,9 @@ void XFFrameStyle::SetShadow(XFShadow *pShadow)
m_pShadow.reset(pShadow); m_pShadow.reset(pShadow);
} }
void XFFrameStyle::SetBackImage(XFBGImage *image) void XFFrameStyle::SetBackImage(std::unique_ptr<XFBGImage>& rImage)
{ {
m_pBGImage.reset(image); m_pBGImage = std::move(rImage);
} }
enumXFStyle XFFrameStyle::GetStyleFamily() enumXFStyle XFFrameStyle::GetStyleFamily()
......
...@@ -108,9 +108,9 @@ void XFHeaderStyle::SetBorders(XFBorders *pBorders) ...@@ -108,9 +108,9 @@ void XFHeaderStyle::SetBorders(XFBorders *pBorders)
m_pBorders.reset(pBorders); m_pBorders.reset(pBorders);
} }
void XFHeaderStyle::SetBackImage(XFBGImage *image) void XFHeaderStyle::SetBackImage(std::unique_ptr<XFBGImage>& rImage)
{ {
m_pBGImage.reset( image ); m_pBGImage = std::move(rImage);
} }
void XFHeaderStyle::SetBackColor(XFColor color) void XFHeaderStyle::SetBackColor(XFColor color)
......
...@@ -125,9 +125,9 @@ void XFPageMaster::SetBackColor(XFColor color) ...@@ -125,9 +125,9 @@ void XFPageMaster::SetBackColor(XFColor color)
m_aBackColor = color; m_aBackColor = color;
} }
void XFPageMaster::SetBackImage(XFBGImage *image) void XFPageMaster::SetBackImage(std::unique_ptr<XFBGImage>& rImage)
{ {
m_pBGImage.reset( image ); m_pBGImage = std::move(rImage);
} }
void XFPageMaster::SetColumns(XFColumns *pColumns) void XFPageMaster::SetColumns(XFColumns *pColumns)
......
...@@ -224,9 +224,9 @@ void XFParaStyle::SetBackColor(XFColor const & color) ...@@ -224,9 +224,9 @@ void XFParaStyle::SetBackColor(XFColor const & color)
m_nFlag |= XFPARA_FLAG_BACKCOLOR; m_nFlag |= XFPARA_FLAG_BACKCOLOR;
} }
void XFParaStyle::SetBackImage(XFBGImage *image) void XFParaStyle::SetBackImage(std::unique_ptr<XFBGImage>& rImage)
{ {
m_pBGImage.reset( image ); m_pBGImage = std::move(rImage);
} }
void XFParaStyle::SetBorders(XFBorders *pBorders) void XFParaStyle::SetBorders(XFBorders *pBorders)
......
...@@ -70,9 +70,9 @@ XFTableStyle::~XFTableStyle() ...@@ -70,9 +70,9 @@ XFTableStyle::~XFTableStyle()
{ {
} }
void XFTableStyle::SetBackImage(XFBGImage *pImage) void XFTableStyle::SetBackImage(std::unique_ptr<XFBGImage>& rImage)
{ {
m_pBGImage.reset( pImage ); m_pBGImage = std::move(rImage);
} }
enumXFStyle XFTableStyle::GetStyleFamily() enumXFStyle XFTableStyle::GetStyleFamily()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment