summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-28 11:41:31 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-28 15:08:48 +0100
commite8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch)
treeb322529f4a54a6427862cb20cb4cf87fb6a5d065 /svx/source/svdraw
parent2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff)
parent0cde74f788a054fa2b65107a030dd463b8d11c7a (diff)
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts. Conflicts: accessibility/source/extended/accessiblelistbox.cxx accessibility/source/standard/vclxaccessiblecombobox.cxx accessibility/source/standard/vclxaccessibledropdowncombobox.cxx accessibility/source/standard/vclxaccessibledropdownlistbox.cxx accessibility/source/standard/vclxaccessiblelistbox.cxx accessibility/source/standard/vclxaccessibletextfield.cxx basctl/source/basicide/basidesh.cxx cui/source/inc/chardlg.hxx cui/source/tabpages/tpbitmap.cxx dbaccess/source/ui/dlg/UserAdmin.cxx dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx extensions/source/propctrlr/propertyeditor.hxx extensions/source/scanner/sanedlg.cxx filter/source/pdf/impdialog.cxx include/sfx2/mgetempl.hxx include/sfx2/sidebar/SidebarToolBox.hxx include/sfx2/viewsh.hxx include/svtools/brwbox.hxx include/svtools/filectrl.hxx include/svtools/scrwin.hxx include/svx/dlgctrl.hxx include/svx/sidebar/Popup.hxx include/svx/sidebar/PopupContainer.hxx include/svx/sidebar/PopupControl.hxx include/svx/sidebar/SidebarDialControl.hxx include/svx/sidebar/ValueSetWithTextControl.hxx sc/source/ui/condformat/condformatdlgentry.cxx sc/source/ui/navipi/navipi.cxx sc/source/ui/sidebar/CellBorderStyleControl.hxx sd/source/ui/animations/CustomAnimationDialog.cxx sd/source/ui/inc/DrawViewShell.hxx sd/source/ui/inc/Ruler.hxx sd/source/ui/inc/SlideSorter.hxx sd/source/ui/inc/ViewTabBar.hxx sd/source/ui/inc/Window.hxx sd/source/ui/inc/morphdlg.hxx sd/source/ui/inc/sdpreslt.hxx sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx sd/source/ui/sidebar/LayoutMenu.hxx sd/source/ui/sidebar/MasterPagesSelector.hxx sd/source/ui/sidebar/NavigatorWrapper.hxx sd/source/ui/sidebar/PanelBase.hxx sd/source/ui/sidebar/RecentMasterPagesSelector.cxx sd/source/ui/sidebar/RecentMasterPagesSelector.hxx sd/source/ui/slideshow/showwindow.hxx sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx sd/source/ui/view/ViewShellBase.cxx sd/source/ui/view/drviewsa.cxx sfx2/source/appl/fileobj.hxx sfx2/source/appl/opengrf.cxx sfx2/source/control/thumbnailviewacc.hxx sfx2/source/dialog/securitypage.cxx sfx2/source/dialog/templdlg.cxx sfx2/source/doc/docinsert.cxx sfx2/source/doc/guisaveas.cxx sfx2/source/inc/alienwarn.hxx sfx2/source/sidebar/Deck.cxx sfx2/source/sidebar/Deck.hxx sfx2/source/sidebar/DeckTitleBar.cxx sfx2/source/sidebar/DeckTitleBar.hxx sfx2/source/sidebar/MenuButton.cxx sfx2/source/sidebar/MenuButton.hxx sfx2/source/sidebar/Panel.cxx sfx2/source/sidebar/Panel.hxx sfx2/source/sidebar/PanelTitleBar.hxx sfx2/source/sidebar/SidebarDockingWindow.hxx sfx2/source/sidebar/SidebarToolBox.cxx sfx2/source/sidebar/TabBar.hxx sfx2/source/sidebar/TabItem.cxx sfx2/source/sidebar/TabItem.hxx sfx2/source/sidebar/TitleBar.hxx sfx2/source/toolbox/imgmgr.cxx starmath/inc/edit.hxx starmath/inc/smmod.hxx starmath/qa/cppunit/test_starmath.cxx starmath/source/edit.cxx starmath/source/smmod.cxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/datwin.hxx svtools/source/contnr/fileview.cxx svtools/source/contnr/simptabl.cxx svtools/source/control/filectrl.cxx svtools/source/control/valueimp.hxx svx/inc/GalleryControl.hxx svx/source/dialog/dlgctrl.cxx svx/source/dialog/swframeexample.cxx svx/source/fmcomp/fmgridif.cxx svx/source/gallery2/GalleryControl.cxx svx/source/sidebar/EmptyPanel.hxx svx/source/sidebar/area/AreaPropertyPanel.hxx svx/source/sidebar/area/AreaTransparencyGradientControl.hxx svx/source/sidebar/graphic/GraphicPropertyPanel.hxx svx/source/sidebar/insert/InsertPropertyPanel.cxx svx/source/sidebar/insert/InsertPropertyPanel.hxx svx/source/sidebar/line/LinePropertyPanel.hxx svx/source/sidebar/line/LineWidthControl.cxx svx/source/sidebar/line/LineWidthControl.hxx svx/source/sidebar/line/LineWidthValueSet.hxx svx/source/sidebar/paragraph/ParaPropertyPanel.hxx svx/source/sidebar/possize/SidebarDialControl.cxx svx/source/sidebar/text/TextCharacterSpacingPopup.hxx svx/source/sidebar/text/TextPropertyPanel.hxx svx/source/sidebar/tools/PopupContainer.cxx svx/source/sidebar/tools/PopupControl.cxx svx/source/sidebar/tools/ValueSetWithTextControl.cxx svx/source/svdraw/svdfmtf.hxx svx/source/svdraw/svdibrow.cxx svx/source/tbxctrls/colrctrl.cxx svx/source/tbxctrls/tbcontrl.cxx sw/source/ui/dbui/mmaddressblockpage.cxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/index/cnttab.cxx sw/source/uibase/inc/drpcps.hxx sw/source/uibase/sidebar/PageColumnControl.hxx sw/source/uibase/sidebar/PageMarginControl.hxx sw/source/uibase/sidebar/PageOrientationControl.hxx sw/source/uibase/sidebar/PagePropertyPanel.hxx sw/source/uibase/sidebar/PageSizeControl.hxx sw/source/uibase/uiview/view2.cxx sw/source/uibase/utlui/navipi.cxx vcl/inc/svdata.hxx vcl/source/control/combobox.cxx vcl/source/control/lstbox.cxx vcl/source/window/dockwin.cxx vcl/source/window/winproc.cxx Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx38
-rw-r--r--svx/source/svdraw/svdedxv.cxx30
-rw-r--r--svx/source/svdraw/svdfmtf.cxx54
-rw-r--r--svx/source/svdraw/svdfmtf.hxx36
-rw-r--r--svx/source/svdraw/svdibrow.cxx51
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2
-rw-r--r--svx/source/svdraw/svdmrkv1.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx10
-rw-r--r--svx/source/svdraw/svdotext.cxx8
-rw-r--r--svx/source/svdraw/svdpntv.cxx26
-rw-r--r--svx/source/svdraw/svdtrans.cxx16
-rw-r--r--svx/source/svdraw/svdview.cxx18
-rw-r--r--svx/source/svdraw/svdxcgv.cxx22
13 files changed, 158 insertions, 155 deletions
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 8692c53bdfae..0440ba195faf 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -33,8 +33,8 @@
//sibling after that is going to fail hard
class CandidateMgr
{
- std::vector<vcl::Window*> m_aCandidates;
- std::set<vcl::Window*> m_aDeletedCandidates;
+ std::vector<VclPtr<vcl::Window> > m_aCandidates;
+ std::set<VclPtr<vcl::Window> > m_aDeletedCandidates;
DECL_LINK(WindowEventListener, VclSimpleEvent*);
public:
void PaintTransparentChildren(vcl::Window & rWindow, Rectangle const& rPixelRect);
@@ -58,10 +58,9 @@ IMPL_LINK(CandidateMgr, WindowEventListener, VclSimpleEvent*, pEvent)
CandidateMgr::~CandidateMgr()
{
- for (std::vector<vcl::Window*>::iterator aI = m_aCandidates.begin();
- aI != m_aCandidates.end(); ++aI)
+ for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
{
- vcl::Window* pCandidate = *aI;
+ VclPtr<vcl::Window> pCandidate = *aI;
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
continue;
pCandidate->RemoveEventListener(LINK(this, CandidateMgr, WindowEventListener));
@@ -97,8 +96,7 @@ void CandidateMgr::PaintTransparentChildren(vcl::Window & rWindow, Rectangle con
pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
}
- for (std::vector<vcl::Window*>::iterator aI = m_aCandidates.begin();
- aI != m_aCandidates.end(); ++aI)
+ for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
{
pCandidate = *aI;
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
@@ -115,31 +113,33 @@ void CandidateMgr::PaintTransparentChildren(vcl::Window & rWindow, Rectangle con
}
SdrPreRenderDevice::SdrPreRenderDevice(OutputDevice& rOriginal)
-: mrOutputDevice(rOriginal)
+: mrOutputDevice(rOriginal),
+ mpPreRenderDevice(VclPtr<VirtualDevice>::Create())
{
}
SdrPreRenderDevice::~SdrPreRenderDevice()
{
+ mpPreRenderDevice.disposeAndClear();
}
void SdrPreRenderDevice::PreparePreRenderDevice()
{
- // compare size of maPreRenderDevice with size of visible area
- if(maPreRenderDevice.GetOutputSizePixel() != mrOutputDevice.GetOutputSizePixel())
+ // compare size of mpPreRenderDevice with size of visible area
+ if(mpPreRenderDevice->GetOutputSizePixel() != mrOutputDevice.GetOutputSizePixel())
{
- maPreRenderDevice.SetOutputSizePixel(mrOutputDevice.GetOutputSizePixel());
+ mpPreRenderDevice->SetOutputSizePixel(mrOutputDevice.GetOutputSizePixel());
}
// Also compare the MapModes for zoom/scroll changes
- if(maPreRenderDevice.GetMapMode() != mrOutputDevice.GetMapMode())
+ if(mpPreRenderDevice->GetMapMode() != mrOutputDevice.GetMapMode())
{
- maPreRenderDevice.SetMapMode(mrOutputDevice.GetMapMode());
+ mpPreRenderDevice->SetMapMode(mrOutputDevice.GetMapMode());
}
// #i29186#
- maPreRenderDevice.SetDrawMode(mrOutputDevice.GetDrawMode());
- maPreRenderDevice.SetSettings(mrOutputDevice.GetSettings());
+ mpPreRenderDevice->SetDrawMode(mrOutputDevice.GetDrawMode());
+ mpPreRenderDevice->SetSettings(mrOutputDevice.GetSettings());
}
void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegion)
@@ -151,9 +151,9 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
// MapModes off
bool bMapModeWasEnabledDest(mrOutputDevice.IsMapModeEnabled());
- bool bMapModeWasEnabledSource(maPreRenderDevice.IsMapModeEnabled());
+ bool bMapModeWasEnabledSource(mpPreRenderDevice->IsMapModeEnabled());
mrOutputDevice.EnableMapMode(false);
- maPreRenderDevice.EnableMapMode(false);
+ mpPreRenderDevice->EnableMapMode(false);
RectangleVector aRectangles;
aRegionPixel.GetRegionRectangles(aRectangles);
@@ -167,7 +167,7 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
mrOutputDevice.DrawOutDev(
aTopLeft, aSize,
aTopLeft, aSize,
- maPreRenderDevice);
+ *mpPreRenderDevice.get());
#ifdef DBG_UTIL
// #i74769#
@@ -188,7 +188,7 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
}
mrOutputDevice.EnableMapMode(bMapModeWasEnabledDest);
- maPreRenderDevice.EnableMapMode(bMapModeWasEnabledSource);
+ mpPreRenderDevice->EnableMapMode(bMapModeWasEnabledSource);
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 7923c7aac6d1..0d4ee090e7d6 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -722,7 +722,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
pTextEditOutlinerView->ShowCursor();
pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
pTextEditOutliner->ClearModifyFlag();
@@ -1202,7 +1202,7 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1218,7 +1218,7 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin)
if (!bPostIt) {
Point aPt(rMEvt.GetPosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
+ else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
bPostIt=IsTextEditHit(aPt,nHitTolLog);
}
if (bPostIt) {
@@ -1236,7 +1236,7 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin)
if (pTextEditOutlinerView->MouseButtonDown(aMEvt)) {
if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1253,7 +1253,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin)
if (!bPostIt) {
Point aPt(rMEvt.GetPosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
+ else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
bPostIt=IsTextEditHit(aPt,nHitTolLog);
}
if (bPostIt) {
@@ -1267,7 +1267,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin)
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseButtonUp(aMEvt)) {
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1305,7 +1305,7 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin)
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseMove(aMEvt) && bSelMode) {
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1325,7 +1325,7 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
if (!bPostIt && rCEvt.IsMouseEvent()) {
Point aPt(rCEvt.GetMousePosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
+ else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
bPostIt=IsTextEditHit(aPt,nHitTolLog);
}
if (bPostIt) {
@@ -1342,7 +1342,7 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
pTextEditOutlinerView->Command(aCEvt);
if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1392,7 +1392,7 @@ bool SdrObjEditView::ImpIsTextEditAllSelected() const
void SdrObjEditView::ImpMakeTextCursorAreaVisible()
{
- if (pTextEditOutlinerView!=NULL && pTextEditWin!=NULL) {
+ if (pTextEditOutlinerView!=nullptr && pTextEditWin!=nullptr) {
vcl::Cursor* pCsr=pTextEditWin->GetCursor();
if (pCsr!=NULL) {
Size aSiz(pCsr->GetSize());
@@ -1613,7 +1613,7 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
pTextEditOutlinerView->SetAttribs(rSet);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
+ if (pItemBrowser!=nullptr)
pItemBrowser->SetDirty();
#endif
@@ -1733,7 +1733,7 @@ void SdrObjEditView::ImpMacroUp(const Point& rUpPos)
aHitRec.nTol=nMacroTol;
aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
aHitRec.pPageView=pMacroPV;
- aHitRec.pOut=pMacroWin;
+ aHitRec.pOut=pMacroWin.get();
pMacroObj->PaintMacro(*pMacroWin,Rectangle(),aHitRec);
bMacroDown=false;
}
@@ -1750,7 +1750,7 @@ void SdrObjEditView::ImpMacroDown(const Point& rDownPos)
aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
aHitRec.pPageView=pMacroPV;
aHitRec.bDown=true;
- aHitRec.pOut=pMacroWin;
+ aHitRec.pOut=pMacroWin.get();
pMacroObj->PaintMacro(*pMacroWin,Rectangle(),aHitRec);
bMacroDown=true;
}
@@ -1766,7 +1766,7 @@ void SdrObjEditView::MovMacroObj(const Point& rPnt)
aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
aHitRec.pPageView=pMacroPV;
aHitRec.bDown=bMacroDown;
- aHitRec.pOut=pMacroWin;
+ aHitRec.pOut=pMacroWin.get();
bool bDown=pMacroObj->IsMacroHit(aHitRec);
if (bDown) ImpMacroDown(rPnt);
else ImpMacroUp(rPnt);
@@ -1794,7 +1794,7 @@ bool SdrObjEditView::EndMacroObj()
aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
aHitRec.pPageView=pMacroPV;
aHitRec.bDown=true;
- aHitRec.pOut=pMacroWin;
+ aHitRec.pOut=pMacroWin.get();
bool bRet=pMacroObj->DoMacro(aHitRec);
pMacroObj=NULL;
pMacroPV=NULL;
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index d15f9c0c5a25..0a6974e72084 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -78,7 +78,7 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(
SdrLayerID nLay,
const Rectangle& rRect)
: maTmpList(),
- maVD(),
+ mpVD(VclPtr<VirtualDevice>::Create()),
maScaleRect(rRect),
mnMapScalingOfs(0),
mpLineAttr(0),
@@ -105,10 +105,10 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(
mbLastObjWasLine(false),
maClip()
{
- maVD.EnableOutput(false);
- maVD.SetLineColor();
- maVD.SetFillColor();
- maOldLineColor.SetRed( maVD.GetLineColor().GetRed() + 1 );
+ mpVD->EnableOutput(false);
+ mpVD->SetLineColor();
+ mpVD->SetFillColor();
+ maOldLineColor.SetRed( mpVD->GetLineColor().GetRed() + 1 );
mpLineAttr = new SfxItemSet(rModel.GetItemPool(), XATTR_LINE_FIRST, XATTR_LINE_LAST, 0, 0);
mpFillAttr = new SfxItemSet(rModel.GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0);
mpTextAttr = new SfxItemSet(rModel.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END, 0, 0);
@@ -340,12 +340,12 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
mpLineAttr->Put(XLineWidthItem(0));
}
- maOldLineColor = maVD.GetLineColor();
+ maOldLineColor = mpVD->GetLineColor();
- if(maVD.IsLineColor())
+ if(mpVD->IsLineColor())
{
mpLineAttr->Put(XLineStyleItem(drawing::LineStyle_SOLID));
- mpLineAttr->Put(XLineColorItem(OUString(), maVD.GetLineColor()));
+ mpLineAttr->Put(XLineColorItem(OUString(), mpVD->GetLineColor()));
}
else
{
@@ -390,10 +390,10 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
if(bFill)
{
- if(maVD.IsFillColor())
+ if(mpVD->IsFillColor())
{
mpFillAttr->Put(XFillStyleItem(drawing::FillStyle_SOLID));
- mpFillAttr->Put(XFillColorItem(OUString(), maVD.GetFillColor()));
+ mpFillAttr->Put(XFillColorItem(OUString(), mpVD->GetFillColor()));
}
else
{
@@ -407,7 +407,7 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
if(bText && mbFntDirty)
{
- vcl::Font aFnt(maVD.GetFont());
+ vcl::Font aFnt(mpVD->GetFont());
const sal_uInt32 nHeight(FRound(aFnt.GetSize().Height() * mfScaleY));
mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) );
@@ -429,7 +429,7 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
mpTextAttr->Put(SvxWordLineModeItem(aFnt.IsWordLineMode(), EE_CHAR_WLM));
mpTextAttr->Put(SvxContourItem(aFnt.IsOutline(), EE_CHAR_OUTLINE));
- mpTextAttr->Put(SvxColorItem(maVD.GetTextColor(), EE_CHAR_COLOR));
+ mpTextAttr->Put(SvxColorItem(mpVD->GetTextColor(), EE_CHAR_COLOR));
//... svxfont textitem svditext
mbFntDirty = false;
}
@@ -779,7 +779,7 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
}
// #i73407# reformulation to use new B2DPolygon classes
- if(mbLastObjWasLine && (maOldLineColor == maVD.GetLineColor()) && rSrcPoly.count())
+ if(mbLastObjWasLine && (maOldLineColor == mpVD->GetLineColor()) && rSrcPoly.count())
{
SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : 0;
SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj);
@@ -871,9 +871,9 @@ bool ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPo
void ImpSdrGDIMetaFileImport::checkClip()
{
- if(maVD.IsClipRegion())
+ if(mpVD->IsClipRegion())
{
- maClip = maVD.GetClipRegion().GetAsB2DPolyPolygon();
+ maClip = mpVD->GetClipRegion().GetAsB2DPolyPolygon();
if(isClip())
{
@@ -984,12 +984,12 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt
{
// calc text box size, add 5% to make it fit safely
- FontMetric aFontMetric( maVD.GetFontMetric() );
- vcl::Font aFnt( maVD.GetFont() );
+ FontMetric aFontMetric( mpVD->GetFontMetric() );
+ vcl::Font aFnt( mpVD->GetFont() );
FontAlign eAlg( aFnt.GetAlign() );
- sal_Int32 nTextWidth = (sal_Int32)( maVD.GetTextWidth( rStr ) * mfScaleX );
- sal_Int32 nTextHeight = (sal_Int32)( maVD.GetTextHeight() * mfScaleY );
+ sal_Int32 nTextWidth = (sal_Int32)( mpVD->GetTextWidth( rStr ) * mfScaleX );
+ sal_Int32 nTextHeight = (sal_Int32)( mpVD->GetTextHeight() * mfScaleY );
Point aPos( FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y()) );
Size aSize( nTextWidth, nTextHeight );
@@ -1168,13 +1168,13 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct )
void ImpSdrGDIMetaFileImport::DoAction(MetaLineColorAction& rAct)
{
- rAct.Execute(&maVD);
+ rAct.Execute(mpVD);
}
void ImpSdrGDIMetaFileImport::DoAction(MetaMapModeAction& rAct)
{
MapScaling();
- rAct.Execute(&maVD);
+ rAct.Execute(mpVD);
mbLastObjWasPolyWithoutLine = false;
mbLastObjWasLine = false;
}
@@ -1182,7 +1182,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMapModeAction& rAct)
void ImpSdrGDIMetaFileImport::MapScaling()
{
const size_t nCount(maTmpList.size());
- const MapMode& rMap = maVD.GetMapMode();
+ const MapMode& rMap = mpVD->GetMapMode();
Point aMapOrg( rMap.GetOrigin() );
bool bMov2(aMapOrg.X() != 0 || aMapOrg.Y() != 0);
@@ -1276,7 +1276,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaTextRectAction& rAct)
{
GDIMetaFile aTemp;
- maVD.AddTextRectActions(rAct.GetRect(), rAct.GetText(), rAct.GetStyle(), aTemp);
+ mpVD->AddTextRectActions(rAct.GetRect(), rAct.GetText(), rAct.GetStyle(), aTemp);
DoLoopActions(aTemp, 0, 0);
}
@@ -1558,12 +1558,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
else
{
// gradient transparence
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
- aVDev.SetOutputSizePixel(aBitmapEx.GetBitmap().GetSizePixel());
- aVDev.DrawGradient(Rectangle(Point(0, 0), aVDev.GetOutputSizePixel()), rGradient);
+ pVDev->SetOutputSizePixel(aBitmapEx.GetBitmap().GetSizePixel());
+ pVDev->DrawGradient(Rectangle(Point(0, 0), pVDev->GetOutputSizePixel()), rGradient);
- aNewMask = AlphaMask(aVDev.GetBitmap(Point(0, 0), aVDev.GetOutputSizePixel()));
+ aNewMask = AlphaMask(pVDev->GetBitmap(Point(0, 0), pVDev->GetOutputSizePixel()));
bHasNewMask = true;
}
diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx
index 33435955f93e..c7c32f4619e2 100644
--- a/svx/source/svdraw/svdfmtf.hxx
+++ b/svx/source/svdraw/svdfmtf.hxx
@@ -45,7 +45,7 @@ class ImpSdrGDIMetaFileImport
{
protected:
::std::vector< SdrObject* > maTmpList;
- VirtualDevice maVD;
+ ScopedVclPtr<VirtualDevice> mpVD;
Rectangle maScaleRect;
size_t mnMapScalingOfs; // from here on, not edited with MapScaling
SfxItemSet* mpLineAttr;
@@ -106,18 +106,18 @@ protected:
void DoAction(MetaHatchAction & rAct);
void DoAction(MetaLineColorAction & rAct);
void DoAction(MetaMapModeAction & rAct);
- void DoAction(MetaFillColorAction & rAct) { rAct.Execute(&maVD); }
- void DoAction(MetaTextColorAction & rAct) { rAct.Execute(&maVD); }
- void DoAction(MetaTextFillColorAction & rAct) { rAct.Execute(&maVD); }
- void DoAction(MetaFontAction & rAct) { rAct.Execute(&maVD); mbFntDirty = true; }
- void DoAction(MetaTextAlignAction & rAct) { rAct.Execute(&maVD); mbFntDirty = true; }
- void DoAction(MetaClipRegionAction & rAct) { rAct.Execute(&maVD); checkClip(); }
- void DoAction(MetaRasterOpAction & rAct) { rAct.Execute(&maVD); }
- void DoAction(MetaPushAction & rAct) { rAct.Execute(&maVD); checkClip(); }
- void DoAction(MetaPopAction & rAct) { rAct.Execute(&maVD); mbFntDirty = true; checkClip(); }
- void DoAction(MetaMoveClipRegionAction & rAct) { rAct.Execute(&maVD); checkClip(); }
- void DoAction(MetaISectRectClipRegionAction& rAct) { rAct.Execute(&maVD); checkClip(); }
- void DoAction(MetaISectRegionClipRegionAction& rAct) { rAct.Execute(&maVD); checkClip(); }
+ void DoAction(MetaFillColorAction & rAct) { rAct.Execute(mpVD); }
+ void DoAction(MetaTextColorAction & rAct) { rAct.Execute(mpVD); }
+ void DoAction(MetaTextFillColorAction & rAct) { rAct.Execute(mpVD); }
+ void DoAction(MetaFontAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
+ void DoAction(MetaTextAlignAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
+ void DoAction(MetaClipRegionAction & rAct) { rAct.Execute(mpVD); checkClip(); }
+ void DoAction(MetaRasterOpAction & rAct) { rAct.Execute(mpVD); }
+ void DoAction(MetaPushAction & rAct) { rAct.Execute(mpVD); checkClip(); }
+ void DoAction(MetaPopAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; checkClip(); }
+ void DoAction(MetaMoveClipRegionAction & rAct) { rAct.Execute(mpVD); checkClip(); }
+ void DoAction(MetaISectRectClipRegionAction& rAct) { rAct.Execute(mpVD); checkClip(); }
+ void DoAction(MetaISectRegionClipRegionAction& rAct) { rAct.Execute(mpVD); checkClip(); }
// #i125211# The MetaCommentAction needs to advance (if used), thus
// give current metafile and index which may be changed
@@ -134,14 +134,14 @@ protected:
static void DoAction(MetaWallpaperAction& rAct);
void DoAction(MetaTransparentAction& rAct);
static void DoAction(MetaEPSAction& rAct);
- void DoAction(MetaRefPointAction& rAct) { rAct.Execute(&maVD); }
- void DoAction(MetaTextLineColorAction& rAct) { rAct.Execute(&maVD); mbFntDirty = true; }
+ void DoAction(MetaRefPointAction& rAct) { rAct.Execute(mpVD); }
+ void DoAction(MetaTextLineColorAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
static void DoAction(MetaTextLineAction& rAct);
void DoAction(MetaFloatTransparentAction& rAct);
void DoAction(MetaGradientExAction& rAct);
- void DoAction(MetaLayoutModeAction& rAct) { rAct.Execute(&maVD); mbFntDirty = true; }
- void DoAction(MetaTextLanguageAction& rAct) { rAct.Execute(&maVD); mbFntDirty = true; }
- void DoAction(MetaOverlineColorAction& rAct) { rAct.Execute(&maVD); mbFntDirty = true; }
+ void DoAction(MetaLayoutModeAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
+ void DoAction(MetaTextLanguageAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
+ void DoAction(MetaOverlineColorAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
void ImportText(const Point& rPos, const OUString& rStr, const MetaAction& rAct);
void SetAttributes(SdrObject* pObj, bool bForceTextAttr = false);
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index d816c0ede1c6..cddf3dfa9954 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -162,22 +162,18 @@ bool ImpItemListRow::operator==(const ImpItemListRow& rEntry) const
class ImpItemEdit: public Edit
{
- _SdrItemBrowserControl* pBrowse;
+ VclPtr<_SdrItemBrowserControl> pBrowse;
public:
ImpItemEdit(vcl::Window* pParent, _SdrItemBrowserControl* pBrowse_, WinBits nBits=0)
: Edit(pParent, nBits),
pBrowse(pBrowse_)
{}
-
- virtual ~ImpItemEdit();
+ virtual ~ImpItemEdit() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { pBrowse.clear(); Edit::dispose(); }
virtual void KeyInput(const KeyEvent& rEvt) SAL_OVERRIDE;
};
-ImpItemEdit::~ImpItemEdit()
-{
-}
-
void ImpItemEdit::KeyInput(const KeyEvent& rKEvt)
{
_SdrItemBrowserControl* pBrowseMerk = pBrowse;
@@ -217,11 +213,17 @@ _SdrItemBrowserControl::_SdrItemBrowserControl(vcl::Window* pParent, WinBits nBi
_SdrItemBrowserControl::~_SdrItemBrowserControl()
{
- delete pEditControl;
+ disposeOnce();
+}
+
+void _SdrItemBrowserControl::dispose()
+{
+ pEditControl.disposeAndClear();
delete pAktChangeEntry;
Clear();
+ BrowseBox::dispose();
}
void _SdrItemBrowserControl::ImpCtor()
@@ -493,7 +495,7 @@ bool _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
ImpItemListRow* pEntry=ImpGetEntry(nPos);
if (pEntry!=NULL && !pEntry->bComment) {
SetMode(MYBROWSEMODE & BrowserMode(~BrowserMode::KEEPHIGHLIGHT));
- pEditControl=new ImpItemEdit(&GetDataWindow(),this,0);
+ pEditControl=VclPtr<ImpItemEdit>::Create(&GetDataWindow(),this,0);
Rectangle aRect(GetFieldRectPixel(nPos, ITEMBROWSER_VALUECOL_ID, false));
aRect.Left()+=2; // little offset for the Edit, so it's exact to the pixel
aRect.Right()--;
@@ -528,10 +530,9 @@ bool _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
bool _SdrItemBrowserControl::EndChangeEntry()
{
bool bRet = false;
- if (pEditControl!=NULL) {
+ if (pEditControl!=nullptr) {
aEntryChangedHdl.Call(this);
- delete pEditControl;
- pEditControl=NULL;
+ pEditControl.disposeAndClear();
delete pAktChangeEntry;
pAktChangeEntry=NULL;
vcl::Window* pParent=GetParent();
@@ -544,9 +545,8 @@ bool _SdrItemBrowserControl::EndChangeEntry()
void _SdrItemBrowserControl::BrkChangeEntry()
{
- if (pEditControl!=NULL) {
- delete pEditControl;
- pEditControl=NULL;
+ if (pEditControl!=nullptr) {
+ pEditControl.disposeAndClear();
delete pAktChangeEntry;
pAktChangeEntry=NULL;
vcl::Window* pParent=GetParent();
@@ -1046,25 +1046,32 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
_SdrItemBrowserWindow::_SdrItemBrowserWindow(vcl::Window* pParent, WinBits nBits):
FloatingWindow(pParent,nBits),
- aBrowse(this)
+ aBrowse(VclPtr<_SdrItemBrowserControl>::Create(this))
{
- SetOutputSizePixel(aBrowse.GetSizePixel());
+ SetOutputSizePixel(aBrowse->GetSizePixel());
SetText(OUString("Joe's ItemBrowser"));
- aBrowse.Show();
+ aBrowse->Show();
}
_SdrItemBrowserWindow::~_SdrItemBrowserWindow()
{
+ disposeOnce();
+}
+
+void _SdrItemBrowserWindow::dispose()
+{
+ aBrowse.disposeAndClear();
+ FloatingWindow::dispose();
}
void _SdrItemBrowserWindow::Resize()
{
- aBrowse.SetSizePixel(GetOutputSizePixel());
+ aBrowse->SetSizePixel(GetOutputSizePixel());
}
void _SdrItemBrowserWindow::GetFocus()
{
- aBrowse.GrabFocus();
+ aBrowse->GrabFocus();
}
// - SdrItemBrowser -
@@ -1075,8 +1082,8 @@ SdrItemBrowser::SdrItemBrowser(SdrView& rView):
bDirty(false)
{
aIdle.SetIdleHdl(LINK(this,SdrItemBrowser,IdleHdl));
- GetBrowserControl().SetEntryChangedHdl(LINK(this,SdrItemBrowser,ChangedHdl));
- GetBrowserControl().SetSetDirtyHdl(LINK(this,SdrItemBrowser,SetDirtyHdl));
+ GetBrowserControl()->SetEntryChangedHdl(LINK(this,SdrItemBrowser,ChangedHdl));
+ GetBrowserControl()->SetSetDirtyHdl(LINK(this,SdrItemBrowser,SetDirtyHdl));
SetDirty();
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 1bb16bc1873d..a747bc69889a 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -2090,7 +2090,7 @@ void SdrMarkView::MarkListHasChanged()
bMarkedObjRectDirty=true;
bMarkedPointsRectsDirty=true;
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
bool bOneEdgeMarked=false;
if (GetMarkedObjectCount()==1) {
diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index 81668a5d3926..1dd73677e74c 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -475,7 +475,7 @@ bool SdrMarkView::PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uInt16
if (!IsGluePointEditMode()) return false;
bool bBack=(nOptions & SDRSEARCH_BACKWARD) !=0;
bool bNext=(nOptions & SDRSEARCH_NEXT) !=0;
- OutputDevice* pOut=const_cast<OutputDevice*>(pActualOutDev);
+ OutputDevice* pOut=const_cast<OutputDevice*>(pActualOutDev.get());
if (pOut==NULL) pOut=GetFirstOutputDevice();
if (pOut==NULL) return false;
SortMarkedObjects();
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 9253a46b652d..9e1f49112780 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1026,14 +1026,14 @@ GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedSvg() const
if(isEmbeddedSvg() && GetModel())
{
- VirtualDevice aOut;
+ ScopedVclPtrInstance< VirtualDevice > pOut;
const Rectangle aBoundRect(GetCurrentBoundRect());
const MapMode aMap(GetModel()->GetScaleUnit(), Point(), GetModel()->GetScaleFraction(), GetModel()->GetScaleFraction());
- aOut.EnableOutput(false);
- aOut.SetMapMode(aMap);
- aRetval.Record(&aOut);
- SingleObjectPainter(aOut);
+ pOut->EnableOutput(false);
+ pOut->SetMapMode(aMap);
+ aRetval.Record(pOut);
+ SingleObjectPainter(*pOut.get());
aRetval.Stop();
aRetval.WindStart();
aRetval.Move(-aBoundRect.Left(), -aBoundRect.Top());
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 1cde6ffdc7af..43c1aa31c855 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1877,12 +1877,12 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
// create the MetaFile
pRetval = new GDIMetaFile;
- VirtualDevice aBlackHole;
- aBlackHole.EnableOutput(false);
- pRetval->Record(&aBlackHole);
+ ScopedVclPtrInstance< VirtualDevice > pBlackHole;
+ pBlackHole->EnableOutput(false);
+ pRetval->Record(pBlackHole);
Point aPaintPos = aPaintRect.TopLeft();
- rOutliner.Draw(&aBlackHole, aPaintPos);
+ rOutliner.Draw(pBlackHole, aPaintPos);
pRetval->Stop();
pRetval->WindStart();
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index aa96a6c58eff..59c0fbb36d8a 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -235,10 +235,7 @@ SdrPaintView::~SdrPaintView()
ClearPageView();
#ifdef DBG_UTIL
- if(pItemBrowser)
- {
- delete pItemBrowser;
- }
+ pItemBrowser.disposeAndClear();
#endif
// delete existing SdrPaintWindows
@@ -409,7 +406,7 @@ sal_uInt16 SdrPaintView::ImpGetHitTolLogic(short nHitTol, const OutputDevice* pO
void SdrPaintView::TheresNewMapMode()
{
- if (pActualOutDev!=NULL) {
+ if (pActualOutDev) {
nHitTolLog=(sal_uInt16)pActualOutDev->PixelToLogic(Size(nHitTolPix,0)).Width();
nMinMovLog=(sal_uInt16)pActualOutDev->PixelToLogic(Size(nMinMovPix,0)).Width();
}
@@ -417,7 +414,7 @@ void SdrPaintView::TheresNewMapMode()
void SdrPaintView::SetActualWin(const OutputDevice* pWin)
{
- pActualOutDev=pWin;
+ pActualOutDev = const_cast<OutputDevice *>(pWin);
TheresNewMapMode();
}
@@ -474,7 +471,7 @@ void SdrPaintView::AddWindowToPaintView(OutputDevice* pNewWin)
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
+ if (pItemBrowser!=nullptr)
pItemBrowser->ForceParent();
#endif
}
@@ -496,7 +493,7 @@ void SdrPaintView::DeleteWindowFromPaintView(OutputDevice* pOldWin)
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
+ if (pItemBrowser!=nullptr)
pItemBrowser->ForceParent();
#endif
}
@@ -1061,7 +1058,7 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll)
else aDefaultAttr.Put(rAttr,false); // if FALSE, regard InvalidItems as "holes," not as Default
SetNotPersistDefaultAttr(rAttr,bReplaceAll);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
}
@@ -1084,7 +1081,7 @@ void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRe
}
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
}
@@ -1127,16 +1124,15 @@ bool SdrPaintView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHar
void SdrPaintView::ShowItemBrowser(bool bShow)
{
if (bShow) {
- if (pItemBrowser==NULL) {
- pItemBrowser=new SdrItemBrowser(*static_cast<SdrView*>(this));
+ if (pItemBrowser==nullptr) {
+ pItemBrowser=VclPtr<SdrItemBrowser>::Create(*static_cast<SdrView*>(this));
}
pItemBrowser->Show();
pItemBrowser->GrabFocus();
} else {
- if (pItemBrowser!=NULL) {
+ if (pItemBrowser!=nullptr) {
pItemBrowser->Hide();
- delete pItemBrowser;
- pItemBrowser=NULL;
+ pItemBrowser.disposeAndClear();
}
}
}
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 8e517c5ba9c0..476b4be808e4 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -634,17 +634,17 @@ FrPair GetInchOrMM(MapUnit eU)
case MAP_MM : return FrPair( 1,1);
case MAP_CM : return FrPair( 1,10);
case MAP_PIXEL : {
- VirtualDevice aVD;
- aVD.SetMapMode(MapMode(MAP_100TH_MM));
- Point aP(aVD.PixelToLogic(Point(64,64))); // 64 pixels for more accuracy
+ ScopedVclPtrInstance< VirtualDevice > pVD;
+ pVD->SetMapMode(MapMode(MAP_100TH_MM));
+ Point aP(pVD->PixelToLogic(Point(64,64))); // 64 pixels for more accuracy
return FrPair(6400,aP.X(),6400,aP.Y());
}
case MAP_APPFONT: case MAP_SYSFONT: {
- VirtualDevice aVD;
- aVD.SetMapMode(MapMode(eU));
- Point aP(aVD.LogicToPixel(Point(32,32))); // 32 units for more accuracy
- aVD.SetMapMode(MapMode(MAP_100TH_MM));
- aP=aVD.PixelToLogic(aP);
+ ScopedVclPtrInstance< VirtualDevice > pVD;
+ pVD->SetMapMode(MapMode(eU));
+ Point aP(pVD->LogicToPixel(Point(32,32))); // 32 units for more accuracy
+ pVD->SetMapMode(MapMode(MAP_100TH_MM));
+ aP=pVD->PixelToLogic(aP);
return FrPair(3200,aP.X(),3200,aP.Y());
}
default: break;
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 89589ba4e1bc..e2dd8d4dc3f1 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -488,7 +488,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
// we currently don't account for ticker text
if(pActualOutDev && pActualOutDev->GetOutDevType() == OUTDEV_WINDOW)
{
- OutlinerView aOLV(pOutliner, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)));
+ OutlinerView aOLV(pOutliner, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev.get())));
const EditView& aEV=aOLV.GetEditView();
const SvxFieldItem* pItem=aEV.GetField(aTemporaryTextRelativePosition);
if (pItem!=NULL) {
@@ -822,7 +822,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
if (eHit==SDRHIT_TEXTEDIT)
{
bool bRet2(pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType() &&
- SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)), false, (SdrOutliner*)0L));
+ SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev.get())), false, (SdrOutliner*)0L));
if(bRet2)
{
@@ -906,7 +906,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
} else bRet=BegCreateObj(aLogicPos);
} break;
case SDREVENT_BEGMACROOBJ: {
- bRet=BegMacroObj(aLogicPos,nHitTolLog,rVEvt.pObj,rVEvt.pPV,const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)));
+ bRet=BegMacroObj(aLogicPos,nHitTolLog,rVEvt.pObj,rVEvt.pPV,const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev.get())));
} break;
case SDREVENT_BEGTEXTEDIT: {
if (!IsObjMarked(rVEvt.pObj)) {
@@ -915,7 +915,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
}
bRet = pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType()&&
- SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)), false, (SdrOutliner*)0L);
+ SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev.get())), false, (SdrOutliner*)0L);
if(bRet)
{
@@ -927,8 +927,8 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
} break;
default: break;
} // switch
- if (bRet && pActualOutDev!=NULL && pActualOutDev->GetOutDevType()==OUTDEV_WINDOW) {
- vcl::Window* pWin=const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev));
+ if (bRet && pActualOutDev && pActualOutDev->GetOutDevType()==OUTDEV_WINDOW) {
+ vcl::Window* pWin=const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev.get()));
// left mouse button pressed?
bool bLeftDown=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && rVEvt.bMouseDown;
// left mouse button released?
@@ -970,7 +970,7 @@ Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice*
aHitRec.nTol=nMacroTol;
aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
aHitRec.pPageView=pMacroPV;
- aHitRec.pOut=pMacroWin;
+ aHitRec.pOut=pMacroWin.get();
aHitRec.bDown=bMacroDown;
return pMacroObj->GetMacroPointer(aHitRec);
}
@@ -1362,7 +1362,7 @@ void SdrView::MarkAll()
if (IsTextEdit()) {
GetTextEditOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
} else if (IsGluePointEditMode()) MarkAllGluePoints();
else if (HasMarkablePoints()) MarkAllPoints();
@@ -1377,7 +1377,7 @@ void SdrView::UnmarkAll()
eSel.nStartPos=eSel.nEndPos;
GetTextEditOutlinerView()->SetSelection(eSel);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
} else if (HasMarkedGluePoints()) UnmarkAllGluePoints();
else if (HasMarkedPoints()) UnmarkAllPoints(); // Marked, not Markable!
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 194231e8f365..a033fd8c7eb8 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -553,16 +553,16 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co
if( !aMtf.GetActionSize() )
{
- VirtualDevice aOut;
+ ScopedVclPtrInstance< VirtualDevice > pOut;
const Size aDummySize(2, 2);
- aOut.SetOutputSizePixel(aDummySize);
- aOut.EnableOutput(false);
- aOut.SetMapMode(aMap);
+ pOut->SetOutputSizePixel(aDummySize);
+ pOut->EnableOutput(false);
+ pOut->SetMapMode(aMap);
aMtf.Clear();
- aMtf.Record(&aOut);
+ aMtf.Record(pOut);
- DrawMarkedObj(aOut);
+ DrawMarkedObj(*pOut.get());
aMtf.Stop();
aMtf.WindStart();
@@ -640,7 +640,7 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject*
// if graphic could not be retrieved => go the hard way and create a MetaFile
if( ( GRAPHIC_NONE == aRet.GetType() ) || ( GRAPHIC_DEFAULT == aRet.GetType() ) )
{
- VirtualDevice aOut;
+ ScopedVclPtrInstance< VirtualDevice > pOut;
GDIMetaFile aMtf;
const Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
const MapMode aMap( pModel->GetScaleUnit(),
@@ -648,10 +648,10 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject*
pModel->GetScaleFraction(),
pModel->GetScaleFraction() );
- aOut.EnableOutput( false );
- aOut.SetMapMode( aMap );
- aMtf.Record( &aOut );
- pObj->SingleObjectPainter( aOut );
+ pOut->EnableOutput( false );
+ pOut->SetMapMode( aMap );
+ aMtf.Record( pOut );
+ pObj->SingleObjectPainter( *pOut.get() );
aMtf.Stop();
aMtf.WindStart();