[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 3 commits - basctl/source cui/source extensions/source include/tools sc/source tools/source

Michael Meeks michael.meeks at collabora.com
Fri Apr 10 11:28:04 PDT 2015


 basctl/source/basicide/basobj2.cxx             |    2 -
 cui/source/dialogs/zoom.cxx                    |    3 --
 extensions/source/bibliography/bibview.hxx     |    2 -
 include/tools/errinf.hxx                       |   11 +++++----
 sc/source/ui/condformat/colorformat.cxx        |    1 
 sc/source/ui/condformat/condformatdlgentry.cxx |    2 -
 sc/source/ui/inc/colorformat.hxx               |    1 
 sc/source/ui/inc/gridwin.hxx                   |    4 +--
 sc/source/ui/miscdlgs/autofmt.cxx              |    2 -
 sc/source/ui/view/gridwin.cxx                  |    2 -
 sc/source/ui/view/tabview.cxx                  |    6 ++---
 tools/source/ref/errinf.cxx                    |   29 ++++++++++++++++++-------
 12 files changed, 41 insertions(+), 24 deletions(-)

New commits:
commit e985155bc506c84efba297751c76242406351de7
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 10 19:33:50 2015 +0100

    Misc. other fixing.
    
    Change-Id: Iffdb9951daaf38489f6b788e07d9b14256459fd4

diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 9501011..8505061 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -242,7 +242,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
     OUString aScriptURL;
     SbMethod* pMethod = NULL;
 
-    ScopedVclPtrInstance< MacroChooser > pChooser( NULL, true );
+    ScopedVclPtrInstance< MacroChooser > pChooser( nullptr, true );
     if ( bChooseOnly || !SvtModuleOptions().IsBasicIDE() )
         pChooser->SetMode(MacroChooser::ChooseOnly);
 
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 21a70bc..5b2dff9 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -295,8 +295,7 @@ SvxZoomDialog::~SvxZoomDialog()
 
 void SvxZoomDialog::dispose()
 {
-    delete mpOutSet;
-    mpOutSet = 0;
+    mpOutSet.reset();
     m_pOptimalBtn.clear();
     m_pWholePageBtn.clear();
     m_pPageWidthBtn.clear();
diff --git a/extensions/source/bibliography/bibview.hxx b/extensions/source/bibliography/bibview.hxx
index 0ab5744..1f797c6 100644
--- a/extensions/source/bibliography/bibview.hxx
+++ b/extensions/source/bibliography/bibview.hxx
@@ -65,7 +65,7 @@ namespace bib
     private:
         DECL_STATIC_LINK(BibView, CallMappingHdl, BibView*);
 
-    protected:
+    public:
         // Window overridables
         virtual void    Resize() SAL_OVERRIDE;
 
commit e33d74ff2ef2493b9de558b033c2d05b6ce97069
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 10 19:16:08 2015 +0100

    Make ErrorContext includers happier.
    
    Unclear that it's a great plan to have a circular tools <-> vcl
    dependency like this, but it pre-dates history apparently.
    
    Change-Id: I7a666dbde9ec7cc29a4e260e2012cca4a26b0b29

diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index ae6e140..4a9f07a 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -27,11 +27,12 @@
 #include <tools/rtti.hxx>
 #include <tools/errcode.hxx>
 #include <tools/toolsdllapi.h>
-#include <vcl/vclptr.hxx>
+
+// FIXME: horrible legacy dependency on VCL from tools.
+namespace vcl { class Window; }
 
 class EDcr_Impl;
 class ErrHdl_Impl;
-namespace vcl { class Window; }
 
 class ErrorInfo
 {
@@ -116,20 +117,20 @@ private:
     OUString           aArg;
 };
 
+struct ErrorContextImpl;
 class TOOLS_DLLPUBLIC ErrorContext
 {
     friend class ErrorHandler;
 
 private:
-    ErrorContext*           pNext;
-    VclPtr<vcl::Window>     pWin;
+    ErrorContextImpl *pImpl;
 
 public:
                             ErrorContext(vcl::Window *pWin=0);
     virtual                 ~ErrorContext();
 
     virtual bool            GetString( sal_uIntPtr nErrId, OUString& rCtxStr ) = 0;
-    vcl::Window*            GetParent() { return pWin; }
+    vcl::Window*            GetParent();
 
     static ErrorContext*    GetContext();
 };
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index babe0ac..688cd93 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -186,22 +186,32 @@ static void aDspFunc(const OUString &rErr, const OUString &rAction)
     OSL_FAIL(aErr.getStr());
 }
 
+// FIXME: this is a truly horrible reverse dependency on VCL
+#include <vcl/window.hxx>
+struct ErrorContextImpl
+{
+    ErrorContext*       pNext;
+    VclPtr<vcl::Window> pWin;
+};
+
 ErrorContext::ErrorContext(vcl::Window *pWinP)
 {
+    pImpl = new ErrorContextImpl();
     EDcrData *pData=EDcrData::GetData();
-    ErrorContext *&pHdl=pData->pFirstCtx;
-    pWin=pWinP;
-    pNext=pHdl;
-    pHdl=this;
+    ErrorContext *&pHdl = pData->pFirstCtx;
+    pImpl->pWin = pWinP;
+    pImpl->pNext = pHdl;
+    pHdl = this;
 }
 
 ErrorContext::~ErrorContext()
 {
     ErrorContext **ppCtx=&(EDcrData::GetData()->pFirstCtx);
     while(*ppCtx && *ppCtx!=this)
-        ppCtx=&((*ppCtx)->pNext);
+        ppCtx=&((*ppCtx)->pImpl->pNext);
     if(*ppCtx)
-        *ppCtx=(*ppCtx)->pNext;
+        *ppCtx=(*ppCtx)->pImpl->pNext;
+    delete pImpl;
 }
 
 ErrorContext *ErrorContext::GetContext()
@@ -230,6 +240,11 @@ ErrorHandler::~ErrorHandler()
     delete pImpl;
 }
 
+vcl::Window* ErrorContext::GetParent()
+{
+    return pImpl ? pImpl->pWin.get() : NULL;
+}
+
 void ErrorHandler::RegisterDisplay(WindowDisplayErrorFunc *aDsp)
 {
     EDcrData *pData=EDcrData::GetData();
@@ -276,7 +291,7 @@ sal_uInt16 ErrorHandler::HandleError_Impl(
         pCtx->GetString(pInfo->GetErrorCode(), aAction);
     vcl::Window *pParent=0;
     // Remove parent from context
-    for(;pCtx;pCtx=pCtx->pNext)
+    for(;pCtx;pCtx=pCtx->pImpl->pNext)
         if(pCtx->GetParent())
         {
             pParent=pCtx->GetParent();
commit ece63f8914367a16fda83a32986bd4a5e4270f2d
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 10 18:58:53 2015 +0100

    More calc fixing.
    
    Change-Id: I35e8a6e5ef7944e937c0b73ebc9986c0eaec2df4

diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 5c08ecb..37bae8c 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -137,6 +137,7 @@ void ScDataBarSettingsDlg::dispose()
     mpLbAxisCol.clear();
     mpLbTypeMin.clear();
     mpLbTypeMax.clear();
+    mpLbFillType.clear();
     mpLbAxisPos.clear();
     mpEdMin.clear();
     mpEdMax.clear();
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 8107692..07e3548 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -346,7 +346,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit)
     {
         ScCompiler aComp2( mpDoc, maPos );
         aComp2.SetGrammar( mpDoc->GetGrammar() );
-        if (&maEdVal1 == pEdit)
+        if (maEdVal1 == pEdit)
         {
             OUString aFormula2 = maEdVal2->GetText();
             boost::scoped_ptr<ScTokenArray> pArr2(aComp2.CompileString(aFormula2));
diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx
index e5acc1d..9c0dca8 100644
--- a/sc/source/ui/inc/colorformat.hxx
+++ b/sc/source/ui/inc/colorformat.hxx
@@ -28,6 +28,7 @@ private:
 
     VclPtr<ColorListBox> mpLbPos;
     VclPtr<ColorListBox> mpLbNeg;
+    VclPtr<ColorListBox> mpLbFillType;
     VclPtr<ColorListBox> mpLbAxisCol;
 
     VclPtr<ListBox> mpLbTypeMin;
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ef9b850..26d3d91 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -136,8 +136,8 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou
 
     std::unique_ptr<ScNoteMarker> mpNoteMarker;
 
-    VclPtr<ScFilterListBox>          pFilterBox;
-    VclPtr<FloatingWindow>           pFilterFloat;
+    VclPtr<ScFilterListBox>          mpFilterBox;
+    VclPtr<FloatingWindow>           mpFilterFloat;
     VclPtr<ScCheckListMenuWindow>    mpAutoFilterPopup;
     VclPtr<ScCheckListMenuWindow>    mpDPFieldPopup;
     std::unique_ptr<ScDPFieldButton> mpFilterButton;
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index b881e4e..f07d195 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -57,7 +57,7 @@
 ScAutoFmtPreview::ScAutoFmtPreview(vcl::Window* pParent)
     : Window(pParent)
     , pCurData(NULL)
-    , aVD(new VirtualDevice(*this))
+    , aVD(*this)
     , aScriptedText(*aVD.get())
     , bFitWidth(false)
     , mbRTL(false)
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 217cbbd..a1ab73b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -547,7 +547,7 @@ void ScGridWindow::dispose()
 
     mpFilterBox.disposeAndClear();
     mpFilterFloat.disposeAndClear();
-    delete pNoteMarker;
+    mpNoteMarker.reset();
     mpAutoFilterPopup.disposeAndClear();
     mpDPFieldPopup.disposeAndClear();
 
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 806ac81..00c586c 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -280,7 +280,7 @@ IMPL_LINK_NOARG(ScTabView, TimerHdl)
 // --- Resize ---------------------------------------------------------------------
 
 static void lcl_SetPosSize( vcl::Window& rWindow, const Point& rPos, const Size& rSize,
-                        long nTotalWidth, bool bLayoutRTL )
+                            long nTotalWidth, bool bLayoutRTL )
 {
     Point aNewPos = rPos;
     if ( bLayoutRTL )
@@ -467,7 +467,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
 
                 Point aHSplitterPoint(nPosX + nTabSize + nSizeLt, nPosY + nSizeY);
                 Size aHSplitterSize(nSizeSp, nBarY);
-                lcl_SetPosSize(pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
+                lcl_SetPosSize(*pHSplitter.get(), aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
 
                 Point aHScrollRightPoint(nPosX + nTabSize + nSizeLt + nSizeSp, nPosY + nSizeY);
                 Size aHScrollRightSize(nSizeRt, nBarY);
@@ -486,7 +486,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
 
                 Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
                 Size aHSplitterSize(nSizeSp, nScrollBarSize);
-                lcl_SetPosSize(pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
+                lcl_SetPosSize(*pHSplitter.get(), aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
 
                 Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp, nPosY + nSizeY);
                 Size aHScrollRightSize(nSizeRt, nScrollBarSize);


More information about the Libreoffice-commits mailing list