[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 7 commits - include/vcl svtools/source sw/source vcl/inc vcl/source winaccessibility/source
Michael Meeks
michael.meeks at collabora.com
Thu Apr 23 07:13:40 PDT 2015
include/vcl/controllayout.hxx | 3 +--
include/vcl/event.hxx | 2 +-
include/vcl/opengl/OpenGLContext.hxx | 2 +-
include/vcl/vclevent.hxx | 2 +-
include/vcl/window.hxx | 10 +++++++---
svtools/source/table/tablecontrol_impl.cxx | 1 +
sw/source/core/doc/DocumentDeviceManager.cxx | 2 +-
vcl/inc/opengl/program.hxx | 1 +
vcl/source/helper/lazydelete.cxx | 13 +------------
vcl/source/opengl/OpenGLContext.cxx | 14 ++++++--------
vcl/source/window/dockwin.cxx | 1 +
vcl/source/window/menu.cxx | 3 ---
winaccessibility/source/UAccCOM/AccActionBase.cxx | 8 ++++----
winaccessibility/source/UAccCOM/acccommon.h | 8 ++++----
14 files changed, 30 insertions(+), 40 deletions(-)
New commits:
commit a5a17d0df59780d7aad25d8de026e943f00e8957
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 14:44:03 2015 +0100
winaccessibility: rename unhelpful string defines.
Change-Id: Ib73ddecb9fd49a2e1a5bb690a0f4bbbc77d9047a
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx
index b01e9c8..fabdc40 100644
--- a/winaccessibility/source/UAccCOM/AccActionBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -68,12 +68,12 @@ void GetDfActionByUNORole(XAccessibleContext* pRContext, BSTR* pRet)
switch(Role)
{
case PUSH_BUTTON:
- *pRet = ::SysAllocString(PRESS);
+ *pRet = ::SysAllocString(PRESS_STR);
break;
case RADIO_BUTTON:
case MENU_ITEM:
case LIST_ITEM:
- *pRet = ::SysAllocString(SELECT);
+ *pRet = ::SysAllocString(SELECT_STR);
break;
case CHECK_BOX:
{
@@ -85,13 +85,13 @@ void GetDfActionByUNORole(XAccessibleContext* pRContext, BSTR* pRet)
Sequence<short> pStates = pRState->getStates();
int count = pStates.getLength();
- *pRet = ::SysAllocString(CHECK);
+ *pRet = ::SysAllocString(CHECK_STR);
for( int iIndex = 0;iIndex < count;iIndex++ )
{
if( pStates[iIndex] == AccessibleStateType::CHECKED )
{
SAFE_SYSFREESTRING(*pRet);
- *pRet = ::SysAllocString(UNCHECK);
+ *pRet = ::SysAllocString(UNCHECK_STR);
break;
}
}
diff --git a/winaccessibility/source/UAccCOM/acccommon.h b/winaccessibility/source/UAccCOM/acccommon.h
index b3458d0..869816c 100644
--- a/winaccessibility/source/UAccCOM/acccommon.h
+++ b/winaccessibility/source/UAccCOM/acccommon.h
@@ -53,10 +53,10 @@ enum DM_NIR {
};
-#define SELECT L"Select"
-#define PRESS L"Press"
-#define UNCHECK L"UnCheck"
-#define CHECK L"Check"
+#define SELECT_STR L"Select"
+#define PRESS_STR L"Press"
+#define UNCHECK_STR L"UnCheck"
+#define CHECK_STR L"Check"
//End
static DWORD GetMSAAStateFromUNO(short xState);
commit 799b0f0e6fb224b7adc8059ca275ad0c63654e8a
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 14:04:55 2015 +0100
Windows build fix for VclPtr.
Change-Id: I5444658e53926b3efbc89617ac7474fc48e47773
diff --git a/include/vcl/controllayout.hxx b/include/vcl/controllayout.hxx
index f916724..ea85d37 100644
--- a/include/vcl/controllayout.hxx
+++ b/include/vcl/controllayout.hxx
@@ -24,8 +24,7 @@
#include <tools/gen.hxx>
#include <vector>
#include <vcl/dllapi.h>
-
-class Control;
+#include <vcl/ctrl.hxx>
namespace vcl
{
commit 2e8eee25cfbcfb2a46494d9b2ef81e65831201ed
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 13:57:27 2015 +0100
Kill unused LazyDeletor<Menu>.
Change-Id: Ibd1d27767b5679a3375d43851363de8c207a43ff
diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx
index 45ea7e0..2594ad4 100644
--- a/vcl/source/helper/lazydelete.cxx
+++ b/vcl/source/helper/lazydelete.cxx
@@ -32,9 +32,8 @@ LazyDeletorBase::~LazyDeletorBase()
{
}
-// instantiate instance pointers for LazyDeletor<Window,Menu>
+// instantiate instance pointer for LazyDeletor<Window>
template<> LazyDeletor<vcl::Window>* LazyDeletor<vcl::Window>::s_pOneInstance = NULL;
-template<> LazyDeletor<Menu>* LazyDeletor<Menu>::s_pOneInstance = NULL;
// a list for all LazyeDeletor<T> singletons
static std::vector< LazyDeletorBase* > lcl_aDeletors;
@@ -60,16 +59,6 @@ template<> bool LazyDeletor<vcl::Window>::is_less( vcl::Window* left, vcl::Windo
return left != right && right->IsChild( left, true );
}
-#ifndef LINUX
-// specialized is_less function for Menu
-template<> bool LazyDeletor<Menu>::is_less( Menu* left, Menu* right )
-{
- while( left && left != right )
- left = left->ImplGetStartedFrom();
- return left != NULL;
-}
-#endif
-
DeleteOnDeinitBase::~DeleteOnDeinitBase()
{
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 40a2545..3de9d8d 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -133,9 +133,6 @@ Menu::Menu()
Menu::~Menu()
{
-
- vcl::LazyDeletor<Menu>::Undelete( this );
-
ImplCallEventListeners( VCLEVENT_OBJECT_DYING, ITEMPOS_INVALID );
// at the window free the reference to the accessible component
commit bd4388e4f92d77d34e63858f1d818379e9b077de
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 13:47:02 2015 +0100
Use shared_ptr for OpenGLPrograms, and hide its copy constructor.
Change-Id: Ia1352105acef1ededaf876a224ebc277121d6942
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 80f785f..d2216e4 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -274,7 +274,7 @@ private:
OUString fragmentShader;
OString preamble;
};
- boost::ptr_map<ProgramKey, OpenGLProgram> maPrograms;
+ std::map<ProgramKey, boost::shared_ptr<OpenGLProgram> > maPrograms;
OpenGLProgram* mpCurrentProgram;
#ifdef DBG_UTIL
std::set<SalGraphicsImpl*> maParents;
diff --git a/vcl/inc/opengl/program.hxx b/vcl/inc/opengl/program.hxx
index 8b42dd4..438d7e3 100644
--- a/vcl/inc/opengl/program.hxx
+++ b/vcl/inc/opengl/program.hxx
@@ -39,6 +39,7 @@ private:
TextureList maTextures;
bool mbBlending;
+ OpenGLProgram(const OpenGLProgram ¬Implemented);
public:
OpenGLProgram();
~OpenGLProgram();
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index a619f93..8d298a4 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -13,6 +13,7 @@
#include <vcl/sysdata.hxx>
#include <boost/scoped_array.hpp>
+#include <boost/make_shared.hpp>
#include <vcl/pngwrite.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/graph.hxx>
@@ -1587,20 +1588,17 @@ OpenGLProgram* OpenGLContext::GetProgram( const OUString& rVertexShader, const O
{
ProgramKey aKey( rVertexShader, rFragmentShader, preamble );
- boost::ptr_map<ProgramKey, OpenGLProgram>::iterator
+ std::map< ProgramKey, boost::shared_ptr<OpenGLProgram> >::iterator
it = maPrograms.find( aKey );
if( it != maPrograms.end() )
- return it->second;
+ return it->second.get();
- OpenGLProgram* pProgram = new OpenGLProgram;
+ boost::shared_ptr<OpenGLProgram> pProgram = boost::make_shared<OpenGLProgram>();
if( !pProgram->Load( rVertexShader, rFragmentShader, preamble ) )
- {
- delete pProgram;
return NULL;
- }
- maPrograms.insert(aKey, pProgram);
- return pProgram;
+ maPrograms.insert(std::pair<ProgramKey, boost::shared_ptr<OpenGLProgram> >(aKey, pProgram));
+ return pProgram.get();
}
OpenGLProgram* OpenGLContext::UseProgram( const OUString& rVertexShader, const OUString& rFragmentShader, const OString& preamble )
commit 6cf6e2da24787e7a1238ba105e954946edd2c8cb
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 11:26:44 2015 +0100
Windows compile fix for VclPtr intersection with events.
Unfortunately, not incredibly elegant for now.
Change-Id: I4ac2e6e013671e7d7830f9555c5bd6bb6b7529b8
diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx
index d6829d5..89929d0 100644
--- a/include/vcl/event.hxx
+++ b/include/vcl/event.hxx
@@ -28,9 +28,9 @@
#include <vcl/settings.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/window.hxx>
class AllSettings;
-namespace vcl { class Window; }
struct IDataObject;
namespace com { namespace sun { namespace star { namespace awt {
diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx
index a6a809f..99f329e 100644
--- a/include/vcl/vclevent.hxx
+++ b/include/vcl/vclevent.hxx
@@ -25,13 +25,13 @@
#include <vcl/dllapi.h>
#include <vcl/impdel.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/window.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <list>
#include <vector>
-namespace vcl { class Window; }
class Menu;
namespace com { namespace sun { namespace star {
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index a9ee87d..3134e50 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -31,9 +31,7 @@
#include <vcl/apptypes.hxx>
#include <vcl/cursor.hxx>
#include <vcl/inputctx.hxx>
-#include <vcl/vclevent.hxx>
-// Only for compatibility - because many people outside haven't included event.hxx
-#include <vcl/event.hxx>
+#include <vcl/keycodes.hxx>
#include <vcl/region.hxx>
#include <vcl/salnativewidgets.hxx>
#include <rtl/ustring.hxx>
@@ -63,6 +61,7 @@ class CommandEvent;
class TrackingEvent;
class HelpEvent;
class DataChangedEvent;
+class VclSimpleEvent;
class NotifyEvent;
class SystemWindow;
class SalFrame;
@@ -1454,6 +1453,11 @@ public:
}
+// Only for compatibility - because many people outside haven't included event.hxx
+// These require Window to be defined for VclPtr<Window>
+#include <vcl/vclevent.hxx>
+#include <vcl/event.hxx>
+
#endif // INCLUDED_VCL_WINDOW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 203c5c6706ac3ad44bf3fb23b689b2de8d3f872b
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 10:55:41 2015 +0100
DockWindow missing builder dispose.
Change-Id: I020ce8efc9d2315a0d6d72914976c2a01b893d12
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index d6ed20d..1a5206b 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -486,6 +486,7 @@ void DockingWindow::dispose()
mpFloatWin.clear();
mpOldBorderWin.clear();
mpDialogParent.clear();
+ disposeBuilder();
Window::dispose();
}
commit 6cf375618e0fec7d2c45e1a1b59474839dace584
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Apr 23 10:34:59 2015 +0100
Clarify assertion, and add missing disposeAndClear.
Change-Id: Ief9bdc8607e60c684696525bff095d193483f23e
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index de845d1..8d55e46 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -264,6 +264,7 @@ namespace svt { namespace table
m_pVScroll.disposeAndClear();
m_pHScroll.disposeAndClear();
m_pScrollCorner.disposeAndClear();
+ m_pDataWindow.disposeAndClear();
DELETEZ( m_pTableFunctionSet );
DELETEZ( m_pSelEngine );
}
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx
index 59ebd29..6da2747 100644
--- a/sw/source/core/doc/DocumentDeviceManager.cxx
+++ b/sw/source/core/doc/DocumentDeviceManager.cxx
@@ -65,7 +65,7 @@ SfxPrinter* DocumentDeviceManager::getPrinter(/*[in]*/ bool bCreate ) const
void DocumentDeviceManager::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged )
{
- assert ( !!pP && !pP->isDisposed() );
+ assert ( !pP || !pP->isDisposed() );
if ( pP != mpPrt )
{
if ( bDeleteOld )
More information about the Libreoffice-commits
mailing list