[Libreoffice-commits] core.git: Branch 'private/kohei/headless-perf' - 120 commits - accessibility/inc avmedia/source basctl/inc basic/source chart2/inc chart2/opengl chart2/Package_opengl.mk chart2/source configmgr/inc configmgr/qa configmgr/source cui/source dbaccess/source desktop/Library_sofficeapp.mk desktop/source editeng/source external/libgltf filter/source framework/inc framework/source helpcompiler/source helpcontent2 i18nutil/source idl/inc idl/source include/basic include/editeng include/svl include/tools include/vbahelper include/vcl oox/inc oox/source reportdesign/source sal/cppunittester sal/inc sc/inc sc/source sd/inc sd/source sfx2/inc sfx2/source slideshow/inc sot/qa sot/source starmath/inc starmath/source svl/source svtools/inc svx/inc svx/source sw/inc sw/qa sw/source unotest/Library_unotest.mk unotest/source unotools/inc vcl/inc vcl/source writerfilter/documentation writerfilter/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed May 28 20:11:50 PDT 2014


Rebased ref, commits from common ancestor:
commit ddfcc1a7b1573cb786e32595dbeb0d7f3df91025
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 22:33:29 2014 -0400

    Detach all DocBasicItem objects upon process termination.
    
    To prevent rogue DocBasicItem objects (which are global objects) from
    attempting to stop listening after the main app is dead.
    
    Change-Id: I68a667137ca4e0eff18278f4d2d5dd67466eaf34

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 3d38428..922df3e 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -80,6 +80,11 @@ public:
     void startListening();
     void stopListening();
 
+    void setDisposed( bool bDisposed )
+    {
+        mbDisposed = bDisposed;
+    }
+
     virtual void SAL_CALL queryClosing( const lang::EventObject& rSource, sal_Bool bGetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException, std::exception) SAL_OVERRIDE;
     virtual void SAL_CALL notifyClosing( const lang::EventObject& rSource ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE;
     virtual void SAL_CALL disposing( const lang::EventObject& rSource ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE;
@@ -2007,7 +2012,16 @@ Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic )
     return xModel;
 }
 
-
+void StarBASIC::DetachAllDocBasicItems()
+{
+    DocBasicItemMap& rItems = GaDocBasicItems::get();
+    DocBasicItemMap::iterator it = rItems.begin(), itEnd = rItems.end();
+    for (; it != itEnd; ++it)
+    {
+        DocBasicItemRef xItem = it->second;
+        xItem->setDisposed(true);
+    }
+}
 
 // #118116 Implementation Collection object
 
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 0c6c3e7..01950fc 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
     i18nlangtag \
     sal \
     salhelper \
+    sb \
     sfx \
     svl \
     svt \
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 290312d..b6c4e8c 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -98,6 +98,7 @@
 #include <sfx2/app.hxx>
 #include <svl/itemset.hxx>
 #include <svl/eitem.hxx>
+#include <basic/sbstar.hxx>
 
 #include <svtools/fontsubstconfig.hxx>
 #include <svtools/accessibilityoptions.hxx>
@@ -1766,6 +1767,7 @@ int Desktop::doShutdown()
     // with the solar mutex unlocked, to avoid deadlock:
     sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
     DeregisterServices();
+    StarBASIC::DetachAllDocBasicItems();
     Application::AcquireSolarMutex(nAcquireCount);
     // be sure that path/language options gets destroyed before
     // UCB is deinitialized
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index 2eec72b..cb1d49a 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -174,6 +174,8 @@ public:
 
     static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
         GetModelFromBasic( SbxObject* pBasic );
+
+    static void DetachAllDocBasicItems();
 };
 
 typedef tools::SvRef<StarBASIC> StarBASICRef;
diff --git a/unotest/Library_unotest.mk b/unotest/Library_unotest.mk
index cfc6fc1..3f9d99b 100644
--- a/unotest/Library_unotest.mk
+++ b/unotest/Library_unotest.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_Library_use_libraries,unotest,\
 	cppu \
 	cppuhelper \
 	sal \
+	sb \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/unotest/source/cpp/bootstrapfixturebase.cxx b/unotest/source/cpp/bootstrapfixturebase.cxx
index 87a72a7..c407dc6 100644
--- a/unotest/source/cpp/bootstrapfixturebase.cxx
+++ b/unotest/source/cpp/bootstrapfixturebase.cxx
@@ -15,6 +15,7 @@
 #include <rtl/bootstrap.hxx>
 #include <cppuhelper/bootstrap.hxx>
 #include <comphelper/processfactory.hxx>
+#include <basic/sbstar.hxx>
 
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
@@ -105,6 +106,7 @@ void test::BootstrapFixtureBase::setUp()
 
 void test::BootstrapFixtureBase::tearDown()
 {
+    StarBASIC::DetachAllDocBasicItems();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit db65eec391287c6c9c4100b2ed47b64ee0fd898f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 20:54:50 2014 -0400

    Avoid static local of a singleton.  This crashed writer unit tests.
    
    Change-Id: I7c5f2d372676cdb317a8dad636bf1aab7dd5db37

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 5a37bbc..3d38428 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -128,7 +128,9 @@ void DocBasicItem::stopListening()
     if( mbDisposed ) return;
     mbDisposed = true;
     Any aThisComp;
-    mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp );
+    if (!mrDocBasic.GetUNOConstant("ThisComponent", aThisComp))
+        return;
+
     Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY );
     if( xCloseBC.is() )
     {
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 45e96a2..086445a 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -2427,19 +2427,31 @@ SbUnoObject::~SbUnoObject()
 // pass the introspection on Demand
 void SbUnoObject::doIntrospection( void )
 {
-    static Reference< XIntrospection > xIntrospection;
-
     if( !bNeedIntrospection )
         return;
-    bNeedIntrospection = false;
 
-    if( !xIntrospection.is() )
+    Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
+
+    if (!xContext.is())
+        return;
+
+
+    // get the introspection service
+    Reference<XIntrospection> xIntrospection;
+
+    try
+    {
+        xIntrospection = theIntrospection::get(xContext);
+    }
+    catch ( const css::uno::DeploymentException& ex )
     {
-        // get the introspection service
-        Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
-        xIntrospection = theIntrospection::get( xContext );
     }
 
+    if (!xIntrospection.is())
+        return;
+
+    bNeedIntrospection = false;
+
     // pass the introspection
     try
     {
commit d45c612753129fade8bd5fad4fcc5a417a6df08c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 13:40:19 2014 -0400

    Avoid handling basic manager etc when the embedded scripts are disabled.
    
    This saves a bit of time.
    
    Change-Id: If49f514f6e927830b1f45f4c34587d92429decc5

diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 6a70a33..368858c 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -940,6 +940,11 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
     // but we should have filtered quite some unnecessary calls already.
 
 #ifndef DISABLE_SCRIPTING
+    Reference<document::XEmbeddedScripts> xScripts(_rxComponent, UNO_QUERY);
+    if (!xScripts.is())
+        // Likely BASIC is disabled.
+        return;
+
     BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
     rTheCurrentComponent = _rxComponent;
     if ( pAppMgr )
commit e7b489077ab098a8d097fe310693d486bc5b0dfb
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 12:58:26 2014 -0400

    Don't return basic manager when scripting is disabled.
    
    Change-Id: I782bb4071f89555d93aa87e5b1b28194c907633d

diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index fabd427..6a70a33 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -694,6 +694,9 @@ BasicManager* SfxObjectShell::GetBasicManager() const
 #ifdef DISABLE_SCRIPTING
     return NULL;
 #else
+    if (pImp->m_bNoBasicCapabilities)
+        return NULL;
+
     BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
     if ( !pBasMgr )
         pBasMgr = SFX_APP()->GetBasicManager();
commit 8b6ffbdf0019443c66e3688d9d6607d1ca66e5fb
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 11:13:26 2014 -0400

    Disable script and document recovery when running from lo_documentLoad.
    
    Change-Id: Ie8efb01d02e9e74ff552f13d182ea10737d86121

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3b04559..540d982 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -206,10 +206,13 @@ static LibreOfficeDocument* lo_documentLoad(LibreOffice* pThis, const char* pURL
 
     try
     {
+        uno::Sequence<css::beans::PropertyValue> aArgs(2);
+        aArgs[0].Name = "EmbeddedScriptSupport";
+        aArgs[0].Value <<= false;
+        aArgs[1].Name = "DocumentRecoverySupport";
+        aArgs[1].Value <<= false;
         uno::Reference<lang::XComponent> xComponent;
-        xComponent = xComponentLoader->loadComponentFromURL(
-                                            aURL, OUString("_blank"), 0,
-                                            uno::Sequence<css::beans::PropertyValue>());
+        xComponent = xComponentLoader->loadComponentFromURL(aURL, "_blank", 0, aArgs);
 
         if (xComponent.is())
             return new LibLODocument_Impl(xComponent);
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index afbf092..27ca42d 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -687,7 +687,19 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
 
             // create the new doc
             const OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", OUString() );
-            xModel.set( m_aContext->getServiceManager()->createInstanceWithContext(sServiceName, m_aContext), UNO_QUERY_THROW );
+            bool bScript = aDescriptor.getOrDefault("EmbeddedScriptSupport", true);
+            bool bDocRecovery = aDescriptor.getOrDefault("DocumentRecoverySupport", true);
+
+            uno::Sequence<uno::Any> aArgs(2);
+            beans::PropertyValue aVal;
+            aVal.Name = "EmbeddedScriptSupport";
+            aVal.Value <<= bScript;
+            aArgs[0] <<= aVal;
+            aVal.Name = "DocumentRecoverySupport";
+            aVal.Value <<= bDocRecovery;
+            aArgs[1] <<= aVal;
+
+            xModel.set( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sServiceName, aArgs, m_aContext), UNO_QUERY_THROW );
 
             // load resp. init it
             const Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW );
commit 3b04179572640c74c26f9c9e3146a4b78df0399c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 28 00:46:30 2014 -0400

    Skip UI font check in headless mode.
    
    Change-Id: I249b5394524bab497d421edb7dae08118c5586c5

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f16e6bd..043ee7b 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1235,6 +1235,9 @@ void Window::CopyDeviceArea( SalTwoRect& aPosAry, sal_uInt32 nFlags )
 
 bool Window::ImplCheckUIFont( const Font& rFont )
 {
+    if (Application::IsHeadlessModeEnabled())
+        return true;
+
     if( ImplGetSVData()->maGDIData.mbNativeFontConfig )
         return true;
 
commit 4f2b2f30edb5df82041921de0f3997a00287439a
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue May 27 22:42:27 2014 -0400

    Skip UI update when in headless mode.
    
    Change-Id: I0b86552c4f1343ec9dba0259669a967569c930df

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index cd1a946..7c6163d 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1309,6 +1309,9 @@ void SfxDispatcher::Update_Impl( bool bForce )
 
     Flush();
 
+    if (Application::IsHeadlessModeEnabled())
+        return;
+
     if ( !pImp->pFrame )
         return;
 
commit a71ae24a236aa7bf6c17cad92a1662e63b7a13bf
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Thu May 29 09:27:30 2014 +0900

    Avoid possible memory leaks in case of exceptions
    
    Change-Id: Iac63a5d60478e5cd8e2b77c889c7b312d3d15f67

diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index b5611fa..45e96a2 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -93,6 +93,7 @@ using namespace cppu;
 #include <runtime.hxx>
 
 #include <math.h>
+#include <boost/scoped_array.hpp>
 #include <boost/unordered_map.hpp>
 #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
 #include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
@@ -1399,9 +1400,9 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
 
                     if( nSeqLevel == nDims )
                     {
-                        sal_Int32* pLowerBounds = new sal_Int32[nDims];
-                        sal_Int32* pUpperBounds = new sal_Int32[nDims];
-                        sal_Int32* pActualIndices = new sal_Int32[nDims];
+                        boost::scoped_array<sal_Int32> pLowerBounds(new sal_Int32[nDims]);
+                        boost::scoped_array<sal_Int32> pUpperBounds(new sal_Int32[nDims]);
+                        boost::scoped_array<sal_Int32> pActualIndices(new sal_Int32[nDims]);
                         for( short i = 1 ; i <= nDims ; i++ )
                         {
                             sal_Int32 lBound, uBound;
@@ -1413,11 +1414,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
                         }
 
                         aRetVal = implRekMultiDimArrayToSequence( pArray, aElemType,
-                            nDims - 1, 0, pActualIndices, pLowerBounds, pUpperBounds );
-
-                        delete[] pUpperBounds;
-                        delete[] pLowerBounds;
-                        delete[] pActualIndices;
+                            nDims - 1, 0, pActualIndices.get(), pLowerBounds.get(), pUpperBounds.get() );
                     }
                 }
             }
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index a7c3e45..078a4f9 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -21,6 +21,7 @@
 #include <list>
 
 #include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
 #include <vcl/svapp.hxx>
 #include <tools/stream.hxx>
 #include <svl/brdcst.hxx>
@@ -1779,7 +1780,7 @@ void SbModule::GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache)
     ErrorHdlResetter aErrHdl;
     SbxBase::ResetError();
 
-    SbiParser* pParser = new SbiParser( (StarBASIC*) GetParent(), this );
+    boost::scoped_ptr<SbiParser> pParser(new SbiParser( (StarBASIC*) GetParent(), this ));
     pParser->SetCodeCompleting(true);
 
     while( pParser->Parse() ) {}
@@ -1801,7 +1802,6 @@ void SbModule::GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache)
                 aCache.InsertLocalVar( pSymDef->GetName(), pChildSymDef->GetName(), pParser->aGblStrings.Find(pChildSymDef->GetTypeId()) );
         }
     }
-    delete pParser;
 }
 
 SbxArrayRef SbModule::GetMethods()
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index 9d20c6d..2d6dfab 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/reflection/XIdlMethod.hpp>
 #include <com/sun/star/uno/Exception.hpp>
 #include <basic/codecompletecache.hxx>
+#include <boost/scoped_ptr.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -965,7 +966,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
                     bool bError2 = true;
                     if( bOptional && bCompatible && eTok == EQ )
                     {
-                        SbiConstExpression* pDefaultExpr = new SbiConstExpression( this );
+                        boost::scoped_ptr<SbiConstExpression> pDefaultExpr(new SbiConstExpression( this ));
                         SbxDataType eType2 = pDefaultExpr->GetType();
 
                         sal_uInt16 nStringId;
@@ -978,7 +979,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
                             nStringId = aGblStrings.Add( pDefaultExpr->GetValue(), eType2 );
                         }
                         pPar->SetDefaultId( nStringId );
-                        delete pDefaultExpr;
+                        pDefaultExpr.reset();
 
                         eTok = Next();
                         if( eTok == COMMA || eTok == RPAREN )
diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx
index 90e3dbb..0ac30a6 100644
--- a/basic/source/comp/io.cxx
+++ b/basic/source/comp/io.cxx
@@ -19,6 +19,7 @@
 
 #include "sbcomp.hxx"
 #include "iosys.hxx"
+#include <boost/scoped_ptr.hpp>
 
 // test if there's an I/O channel
 
@@ -51,9 +52,9 @@ void SbiParser::Print()
     {
         if( !IsEoln( Peek() ) )
         {
-            SbiExpression* pExpr = new SbiExpression( this );
+            boost::scoped_ptr<SbiExpression> pExpr(new SbiExpression( this ));
             pExpr->Gen();
-            delete pExpr;
+            pExpr.reset();
             Peek();
             aGen.Gen( eCurTok == COMMA ? _PRINTF : _BPRINT );
         }
@@ -80,9 +81,9 @@ void SbiParser::Write()
 
     while( !bAbort )
     {
-        SbiExpression* pExpr = new SbiExpression( this );
+        boost::scoped_ptr<SbiExpression> pExpr(new SbiExpression( this ));
         pExpr->Gen();
-        delete pExpr;
+        pExpr.reset();
         aGen.Gen( _BWRITE );
         if( Peek() == COMMA )
         {
@@ -129,14 +130,14 @@ void SbiParser::Line()
 void SbiParser::LineInput()
 {
     Channel( true );
-    SbiExpression* pExpr = new SbiExpression( this, SbOPERAND );
+    boost::scoped_ptr<SbiExpression> pExpr(new SbiExpression( this, SbOPERAND ));
     if( !pExpr->IsVariable() )
         Error( SbERR_VAR_EXPECTED );
     if( pExpr->GetType() != SbxVARIANT && pExpr->GetType() != SbxSTRING )
         Error( SbERR_CONVERSION );
     pExpr->Gen();
     aGen.Gen( _LINPUT );
-    delete pExpr;
+    pExpr.reset();
     aGen.Gen( _CHAN0 );     // ResetChannel() not in StepLINPUT() anymore
 }
 
@@ -146,7 +147,7 @@ void SbiParser::Input()
 {
     aGen.Gen( _RESTART );
     Channel( true );
-    SbiExpression* pExpr = new SbiExpression( this, SbOPERAND );
+    boost::scoped_ptr<SbiExpression> pExpr(new SbiExpression( this, SbOPERAND ));
     while( !bAbort )
     {
         if( !pExpr->IsVariable() )
@@ -156,12 +157,11 @@ void SbiParser::Input()
         if( Peek() == COMMA )
         {
             Next();
-            delete pExpr;
-            pExpr = new SbiExpression( this, SbOPERAND );
+            pExpr.reset(new SbiExpression( this, SbOPERAND ));
         }
         else break;
     }
-    delete pExpr;
+    pExpr.reset();
     aGen.Gen( _CHAN0 );
 }
 
@@ -240,20 +240,20 @@ void SbiParser::Open()
     }
     TestToken( AS );
     // channel number
-    SbiExpression* pChan = new SbiExpression( this );
+    boost::scoped_ptr<SbiExpression> pChan(new SbiExpression( this ));
     if( !pChan )
         Error( SbERR_SYNTAX );
-    SbiExpression* pLen = NULL;
+    boost::scoped_ptr<SbiExpression> pLen;
     if( Peek() == SYMBOL )
     {
         Next();
         if( aSym.equalsIgnoreAsciiCase("LEN") )
         {
             TestToken( EQ );
-            pLen = new SbiExpression( this );
+            pLen.reset(new SbiExpression( this ));
         }
     }
-    if( !pLen ) pLen = new SbiExpression( this, 128, SbxINTEGER );
+    if( !pLen ) pLen.reset(new SbiExpression( this, 128, SbxINTEGER ));
     // the stack for the OPEN command looks as follows:
     // block length
     // channel number
@@ -263,8 +263,6 @@ void SbiParser::Open()
         pChan->Gen();
     aFileName.Gen();
     aGen.Gen( _OPEN, nMode, nFlags );
-    delete pLen;
-    delete pChan;
     bInStatement = false;
 }
 
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index 396f283..1de4e15 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -19,6 +19,7 @@
 
 
 #include "sbcomp.hxx"
+#include <boost/scoped_ptr.hpp>
 
 // Single-line IF and Multiline IF
 
@@ -64,10 +65,10 @@ void SbiParser::If()
             aGen.BackChain( nEndLbl );
 
             aGen.Statement();
-            SbiExpression* pCond = new SbiExpression( this );
+            boost::scoped_ptr<SbiExpression> pCond(new SbiExpression( this ));
             pCond->Gen();
             nEndLbl = aGen.Gen( _JUMPF, 0 );
-            delete pCond;
+            pCond.reset();
             TestToken( THEN );
             eTok = Peek();
             while( !( eTok == ELSEIF || eTok == ELSE || eTok == ENDIF ) &&
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index e3f49e7..59b0fd7 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -24,6 +24,7 @@
 #include "sbobjmod.hxx"
 #include <svtools/miscopt.hxx>
 #include <stdio.h>
+#include <boost/scoped_ptr.hpp>
 
 // To activate tracing enable in sbtrace.hxx
 #ifdef DBG_TRACE_BASIC
@@ -954,11 +955,11 @@ bool SbModule::Compile()
     SbModule* pOld = GetSbData()->pCompMod;
     GetSbData()->pCompMod = this;
 
-    SbiParser* pParser = new SbiParser( (StarBASIC*) GetParent(), this );
+    boost::scoped_ptr<SbiParser> pParser(new SbiParser( (StarBASIC*) GetParent(), this ));
     while( pParser->Parse() ) {}
     if( !pParser->GetErrors() )
         pParser->aGen.Save();
-    delete pParser;
+    pParser.reset();
     // for the disassembler
     if( pImage )
         pImage->aOUSource = aOUSource;
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index 152d625..bec0dfb 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -26,6 +26,7 @@
 #include "runtime.hxx"
 #include "stdobj.hxx"
 #include "rtlproto.hxx"
+#include <boost/scoped_ptr.hpp>
 
 class SvRTLInputBox : public ModalDialog
 {
@@ -171,11 +172,10 @@ RTLFUNC(InputBox)
             nX = rPar.Get(4)->GetLong();
             nY = rPar.Get(5)->GetLong();
         }
-        SvRTLInputBox *pDlg=new SvRTLInputBox(GetpApp()->GetDefDialogParent(),
-                    rPrompt,aTitle,aDefault,nX,nY);
+        boost::scoped_ptr<SvRTLInputBox> pDlg(new SvRTLInputBox(GetpApp()->GetDefDialogParent(),
+                    rPrompt,aTitle,aDefault,nX,nY));
         pDlg->Execute();
         rPar.Get(0)->PutString( pDlg->GetText() );
-        delete pDlg;
     }
 }
 
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 2e3c375..02d51db 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -57,6 +57,7 @@
 #include <ooo/vba/XHelperInterface.hpp>
 #include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
 #include <boost/scoped_array.hpp>
+#include <boost/scoped_ptr.hpp>
 
 using namespace comphelper;
 using namespace osl;
@@ -4475,8 +4476,8 @@ RTLFUNC(LoadPicture)
     }
 
     OUString aFileURL = getFullPath( rPar.Get(1)->GetOUString() );
-    SvStream* pStream = utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_READ );
-    if( pStream != NULL )
+    boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_READ ));
+    if( pStream )
     {
         Bitmap aBmp;
         ReadDIB(aBmp, *pStream, true);
@@ -4486,7 +4487,6 @@ RTLFUNC(LoadPicture)
         ((SbStdPicture*)(SbxObject*)xRef)->SetGraphic( aGraphic );
         rPar.Get(0)->PutObject( xRef );
     }
-    delete pStream;
 }
 
 RTLFUNC(SavePicture)
@@ -4601,7 +4601,7 @@ RTLFUNC(MsgBox)
     }
 
     nType &= (16+32+64);
-    MessBox* pBox = 0;
+    boost::scoped_ptr<MessBox> pBox;
 
     SolarMutexGuard aSolarGuard;
 
@@ -4609,19 +4609,19 @@ RTLFUNC(MsgBox)
     switch( nType )
     {
     case 16:
-        pBox = new ErrorBox( pParent, nWinBits, aMsg );
+        pBox.reset(new ErrorBox( pParent, nWinBits, aMsg ));
         break;
     case 32:
-        pBox = new QueryBox( pParent, nWinBits, aMsg );
+        pBox.reset(new QueryBox( pParent, nWinBits, aMsg ));
         break;
     case 48:
-        pBox = new WarningBox( pParent, nWinBits, aMsg );
+        pBox.reset(new WarningBox( pParent, nWinBits, aMsg ));
         break;
     case 64:
-        pBox = new InfoBox( pParent, nWinBits, aMsg );
+        pBox.reset(new InfoBox( pParent, nWinBits, aMsg ));
         break;
     default:
-        pBox = new MessBox( pParent, nWinBits, aTitle, aMsg );
+        pBox.reset(new MessBox( pParent, nWinBits, aTitle, aMsg ));
     }
     pBox->SetText( aTitle );
     sal_uInt16 nRet = (sal_uInt16)pBox->Execute();
@@ -4643,7 +4643,6 @@ RTLFUNC(MsgBox)
         nMappedRet = nButtonMap[ nRet ];
     }
     rPar.Get(0)->PutInteger( nMappedRet );
-    delete pBox;
 }
 
 RTLFUNC(SetAttr)
commit 7c8b2f10310f0f64b111afb3012e82e9c4a690ac
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 28 23:05:28 2014 +0200

    fdo#78737: sw: fix setting tab stops via ruler
    
    The SvxRuler binds the SID_ATTR_PARA_LRSPACE, and its indents and the
    positions of tab stops depend on the values it gets from there; in LO
    4.0 the value came from the SwView::StateTabWin() but now it comes from
    SwTextShell::GetAttrState(), and the difference is that the former does
    a special request to get the NumRule indents as LR-space.
    
    (regression from d02f75a8c36705924ddd6a5921fe3012fafce812)
    
    Change-Id: I548ce188655555f2473cb3973ce7aeb927d1a404

diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 3b62eaa..daa02bb 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -492,7 +492,9 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
     SwWrtShell &rSh = GetShell();
     SfxItemPool& rPool = GetPool();
     SfxItemSet aCoreSet(rPool, aTxtFmtCollSetRange);
-    rSh.GetCurAttr(aCoreSet); // Request *all* text attributes from the core.
+    // Request *all* text attributes from the core.
+    // fdo#78737: this is called from SvxRuler, which requires the list indents!
+    rSh.GetCurAttr(aCoreSet, /* bMergeIndentValuesOfNumRule = */ true);
 
     SfxWhichIter aIter(rSet);
     sal_uInt16 nSlot = aIter.FirstWhich();
commit b2f412a39500fe3b4dedad1cc99c6c6603d2bce4
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 23:17:08 2014 +0200

    Lsan: fix memory leak
    
    Change-Id: I223e0587b5a82c1617a0e79a002472070d2d4402

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 6936f2b..71e9409 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -783,6 +783,8 @@ SystemWindowData OpenGLContext::generateWinData(Window* pParent)
         aWinData.pVisual = (void*)(vi->visual);
     }
 
+    XFree(pFBC);
+
     return aWinData;
 }
 
commit 6b446f95dd77156eac972416072d505a2adf7181
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 18:08:45 2014 +0200

    remove tab in shader
    
    Change-Id: I8641b8c0b478dd23d312fb4e8eed8aa98eb7035e

diff --git a/chart2/opengl/shape3DVertexShaderBatch.glsl b/chart2/opengl/shape3DVertexShaderBatch.glsl
index 8c27c7a..e0a1d30 100644
--- a/chart2/opengl/shape3DVertexShaderBatch.glsl
+++ b/chart2/opengl/shape3DVertexShaderBatch.glsl
@@ -28,7 +28,7 @@ void main()
 
     normalCameraspace = normalize(mat3(V) * normalMatrix * vertexNormalModelspace);
 	
-	fragBarColor = barColor;
+    fragBarColor = barColor;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3d549ff9b4460b520cd9c3a3c02d81a8d1dffb0a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 23:03:44 2014 +0200

    improve the algorithm for the zoom into a bar
    
    Change-Id: Id045cbeaa057fd264a50f83fb58bbee60df71299

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index af232cc..f2ec238 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -67,6 +67,11 @@ const size_t STEPS = 100;
 const sal_uLong TIMEOUT = 5;
 const sal_uInt32 ID_STEP = 10;
 
+const float BAR_SIZE_X = 30.0f;
+const float BAR_SIZE_Y = 5.0f;
+const float BAR_DISTANCE_X = 5.0f;
+const float BAR_DISTANCE_Y = 5.0;
+
 float calculateTextWidth(const OUString& rText)
 {
     return rText.getLength() * 10;
@@ -103,11 +108,6 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     // guarantee they are positioned correctly.  In fact, they are guaranteed
     // to be positioned incorrectly.
 
-    const float nBarSizeX = 30.0f;
-    const float nBarSizeY = 5.0f;
-    const float nBarDistanceX = 5.0f;
-    const float nBarDistanceY = 5.0;
-
     sal_uInt32 nId = 1;
     float nXEnd = 0.0;
     float nYPos = 0.0;
@@ -130,7 +130,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     for (boost::ptr_vector<VDataSeries>::const_iterator itr = rDataSeriesContainer.begin(),
             itrEnd = rDataSeriesContainer.end(); itr != itrEnd; ++itr)
     {
-        nYPos = nSeriesIndex * (nBarSizeY + nBarDistanceY) + nBarDistanceY;
+        nYPos = nSeriesIndex * (BAR_SIZE_Y + BAR_DISTANCE_Y) + BAR_DISTANCE_Y;
 
         const VDataSeries& rDataSeries = *itr;
         sal_Int32 nPointCount = rDataSeries.getTotalPointCount();
@@ -152,10 +152,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             nId += ID_STEP;
             opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back());
             glm::vec3 aTopLeft, aTopRight, aBottomRight;
-            aTopRight.x = -nBarDistanceY;
-            aTopRight.y = nYPos + nBarDistanceY;
-            aTopLeft.x = calculateTextWidth(aSeriesName) * -1.0 - nBarDistanceY;
-            aTopLeft.y = nYPos + nBarDistanceY;
+            aTopRight.x = -BAR_DISTANCE_Y;
+            aTopRight.y = nYPos + BAR_DISTANCE_Y;
+            aTopLeft.x = calculateTextWidth(aSeriesName) * -1.0 - BAR_DISTANCE_Y;
+            aTopLeft.y = nYPos + BAR_DISTANCE_Y;
             aBottomRight = aTopRight;
             aBottomRight.y -= TEXT_HEIGHT;
             p->setPosition(aTopLeft, aTopRight, aBottomRight);
@@ -170,9 +170,9 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             }
 
             float nVal = rDataSeries.getYValue(nIndex);
-            float nXPos = nIndex * (nBarSizeX + nBarDistanceX) + nBarDistanceX;
+            float nXPos = nIndex * (BAR_SIZE_X + BAR_DISTANCE_X) + BAR_DISTANCE_X;
 
-            glm::mat4 aScaleMatrix = glm::scale(glm::vec3(nBarSizeX, nBarSizeY, float(nVal/nMaxVal)));
+            glm::mat4 aScaleMatrix = glm::scale(glm::vec3(BAR_SIZE_X, BAR_SIZE_Y, float(nVal/nMaxVal)));
             glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(nXPos, nYPos, 0.0f));
             glm::mat4 aBarPosition = aTranslationMatrix * aScaleMatrix;
 
@@ -184,14 +184,14 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             nId += ID_STEP;
         }
 
-        float nThisXEnd = nPointCount * (nBarSizeX + nBarDistanceX);
+        float nThisXEnd = nPointCount * (BAR_SIZE_X + BAR_DISTANCE_X);
         if (nXEnd < nThisXEnd)
             nXEnd = nThisXEnd;
 
         ++nSeriesIndex;
     }
 
-    nYPos += nBarSizeY + nBarDistanceY;
+    nYPos += BAR_SIZE_Y + BAR_DISTANCE_Y;
 
     // X axis
     maShapes.push_back(new opengl3D::Line(mpRenderer.get(), nId));
@@ -220,7 +220,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     opengl3D::Rectangle* pRect = static_cast<opengl3D::Rectangle*>(&maShapes.back());
     glm::vec3 aTopLeft;
     glm::vec3 aTopRight = aTopLeft;
-    aTopRight.x = nXEnd + 2 * nBarDistanceX;
+    aTopRight.x = nXEnd + 2 * BAR_DISTANCE_X;
     glm::vec3 aBottomRight = aTopRight;
     aBottomRight.y = nYPos;
     pRect->setPosition(aTopLeft, aTopRight, aBottomRight);
@@ -235,18 +235,18 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
         if(aCats[i].isEmpty())
             continue;
 
-        float nXPos = i * (nBarSizeX + nBarDistanceX);
+        float nXPos = i * (BAR_SIZE_X + BAR_DISTANCE_X);
 
         maShapes.push_back(new opengl3D::Text(mpRenderer.get(), *mpTextCache,
                     aCats[i], nId));
         nId += ID_STEP;
         opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back());
         aTopLeft.x = nXPos + TEXT_HEIGHT;
-        aTopLeft.y = nYPos + calculateTextWidth(aCats[i]) + 0.5 * nBarDistanceY;
+        aTopLeft.y = nYPos + calculateTextWidth(aCats[i]) + 0.5 * BAR_DISTANCE_Y;
         aTopRight = aTopLeft;
-        aTopRight.y = nYPos + 0.5* nBarDistanceY;
+        aTopRight.y = nYPos + 0.5* BAR_DISTANCE_Y;
         aBottomRight.x = nXPos;
-        aBottomRight.y = nYPos + 0.5 * nBarDistanceY;
+        aBottomRight.y = nYPos + 0.5 * BAR_DISTANCE_Y;
         p->setPosition(aTopLeft, aTopRight, aBottomRight);
 
         // create shapes on other side as well
@@ -256,16 +256,16 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
         nId += ID_STEP;
         p = static_cast<opengl3D::Text*>(&maShapes.back());
         aTopLeft.x = nXPos + TEXT_HEIGHT;
-        aTopLeft.y =  - 0.5 * nBarDistanceY;
+        aTopLeft.y =  - 0.5 * BAR_DISTANCE_Y;
         aTopRight = aTopLeft;
-        aTopRight.y = -calculateTextWidth(aCats[i]) - 0.5* nBarDistanceY;
+        aTopRight.y = -calculateTextWidth(aCats[i]) - 0.5* BAR_DISTANCE_Y;
         aBottomRight.x = nXPos;
-        aBottomRight.y = -calculateTextWidth(aCats[i]) - 0.5 * nBarDistanceY;
+        aBottomRight.y = -calculateTextWidth(aCats[i]) - 0.5 * BAR_DISTANCE_Y;
         p->setPosition(aTopLeft, aTopRight, aBottomRight);
     }
 
-    mnMaxX = nMaxPointCount * (nBarSizeX + nBarDistanceX) + 40;
-    mnMaxY = nSeriesIndex * (nBarSizeY + nBarDistanceY) + 40;
+    mnMaxX = nMaxPointCount * (BAR_SIZE_X + BAR_DISTANCE_X) + 40;
+    mnMaxY = nSeriesIndex * (BAR_SIZE_Y + BAR_DISTANCE_Y) + 40;
 
     maCameraPosition = glm::vec3(-30, -30, DEFAULT_CAMERA_HEIGHT);
     mpCamera->setPosition(maCameraPosition);
@@ -354,10 +354,17 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
     const BarInformation& rBarInfo = itr->second;
     mnStepsTotal = STEPS;
     mnStep = 0;
-    maCameraDirection = rBarInfo.maPos;
     render();
 
-    maStep = (rBarInfo.maPos - maCameraPosition)/102.0f;
+    glm::vec3 maTargetPosition = rBarInfo.maPos;
+    maTargetPosition.z += 45;
+    maStep = (maTargetPosition - maCameraPosition)/100.0f;
+
+    glm::vec3 maTargetDirection = rBarInfo.maPos;
+    maTargetDirection.x += BAR_SIZE_X / 2.0f;
+    maTargetDirection.y += BAR_SIZE_Y / 2.0f;
+
+    maStepDirection = (maTargetDirection - maCameraDirection)/100.f;
 
     maTimer.SetTimeout(TIMEOUT);
     maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, MoveToBar));
@@ -426,6 +433,8 @@ void GL3DBarChart::moveToCorner()
 {
     mnStepsTotal = STEPS;
     maStep = (getCornerPosition(mnCornerId) - maCameraPosition) / float(mnStepsTotal);
+
+    maStepDirection = (glm::vec3(mnMaxX/2.0f, mnMaxY/2.0f, 0) - maCameraDirection)/ float(mnStepsTotal);
     maTimer.SetTimeout(TIMEOUT);
     maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, MoveCamera));
     maTimer.Start();
@@ -439,6 +448,8 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveCamera)
         ++mnStep;
         maCameraPosition += maStep;
         mpCamera->setPosition(maCameraPosition);
+        maCameraDirection += maStepDirection;
+        mpCamera->setDirection(maCameraDirection);
         render();
         maTimer.SetTimeout(TIMEOUT);
         maTimer.Start();
@@ -460,6 +471,8 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
         ++mnStep;
         maCameraPosition += maStep;
         mpCamera->setPosition(maCameraPosition);
+        maCameraDirection += maStepDirection;
+        mpCamera->setDirection(maCameraDirection);
         render();
         maTimer.SetTimeout(TIMEOUT);
         maTimer.Start();
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 8c97ca8..0566904 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -79,6 +79,7 @@ private:
 
     Timer maTimer;
     glm::vec3 maStep;
+    glm::vec3 maStepDirection;
     size_t mnStep;
     size_t mnStepsTotal;
     float mnMaxX;
commit 585f615c2d9cf7bfec761c8148d4c49b4d44e794
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 22:29:08 2014 +0200

    show the screen text after the performance improvements
    
    Change-Id: I09d0bfe06e3fbb93f65587a847133fb1b3a3f2b2

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 711072c..af232cc 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -367,7 +367,7 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
                 OUString("Value: ") + OUString::number(rBarInfo.mnVal), 0));
     opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maShapes.back());
     pScreenText->setPosition(glm::vec2(-0.9f, 0.9f), glm::vec2(-0.6f, 0.8f));
-
+    pScreenText->render();
 }
 
 void GL3DBarChart::mouseDragMove(const Point& , const Point& , sal_uInt16 nButtons)
@@ -467,6 +467,7 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
     else
     {
         maShapes.pop_back();
+        mpRenderer->ReleaseScreenTextShapes();
         mbBlockUserInput = false;
         mnStep = 0;
     }
commit 939519560cfbaacb265df8c296fc239fbd5a830c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 22:24:34 2014 +0200

    show the whole demo
    
    Change-Id: I8e3adae6ef23c7750de0bcb5934d5743e24fde58

diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index af5238b..8ee66c2 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -274,7 +274,7 @@ void OpenGL3DRenderer::init()
     glBindBuffer(GL_ARRAY_BUFFER, 0);
 
     m_fViewAngle = 60.0f;
-    m_3DProjection = glm::perspective(m_fViewAngle, (float)m_iWidth / (float)m_iHeight, 0.01f, 2000.0f);
+    m_3DProjection = glm::perspective(m_fViewAngle, (float)m_iWidth / (float)m_iHeight, 0.01f, 6000.0f);
 
     maResources.LoadShaders();
     maPickingResources.LoadShaders();
commit b158fd26951e42a9b31ca2bb4aa0bdd36f26a3ab
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed May 28 23:06:44 2014 +0200

    Prefer cppu::UnoType<T>::get() to ::getCppuType(&T)
    
    See http://nabble.documentfoundation.org/Questions-about-getCppuType-td4106361i20.html
    
    Change-Id: I05d0b026e1ef2088472a42ee20e0823df1588428

diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index b4e8274..07c4077 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -169,51 +169,51 @@ void ODBTable::construct()
     OTable_Base::construct();
 
     registerProperty(PROPERTY_FILTER, PROPERTY_ID_FILTER, PropertyAttribute::BOUND,
-                    &m_sFilter, ::getCppuType(&m_sFilter));
+                    &m_sFilter, cppu::UnoType<OUString>::get());
 
     registerProperty(PROPERTY_ORDER, PROPERTY_ID_ORDER, PropertyAttribute::BOUND,
-                    &m_sOrder, ::getCppuType(&m_sOrder));
+                    &m_sOrder, cppu::UnoType<OUString>::get());
 
     registerProperty(PROPERTY_APPLYFILTER, PROPERTY_ID_APPLYFILTER, PropertyAttribute::BOUND,
-                    &m_bApplyFilter, ::getBooleanCppuType());
+                    &m_bApplyFilter, cppu::UnoType<bool>::get());
 
     registerProperty(PROPERTY_FONT, PROPERTY_ID_FONT, PropertyAttribute::BOUND,
-                    &m_aFont, ::getCppuType(&m_aFont));
+                    &m_aFont, cppu::UnoType<com::sun::star::awt::FontDescriptor>::get());
 
     registerMayBeVoidProperty(PROPERTY_ROW_HEIGHT, PROPERTY_ID_ROW_HEIGHT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
-                    &m_aRowHeight, ::cppu::UnoType<sal_Int32>::get());
+                    &m_aRowHeight, cppu::UnoType<sal_Int32>::get());
 
     registerMayBeVoidProperty(PROPERTY_TEXTCOLOR, PROPERTY_ID_TEXTCOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
-                    &m_aTextColor, ::cppu::UnoType<sal_Int32>::get());
+                    &m_aTextColor, cppu::UnoType<sal_Int32>::get());
 
     registerProperty(PROPERTY_PRIVILEGES, PROPERTY_ID_PRIVILEGES, PropertyAttribute::BOUND | PropertyAttribute::READONLY,
-                    &m_nPrivileges, ::cppu::UnoType<sal_Int32>::get());
+                    &m_nPrivileges, cppu::UnoType<sal_Int32>::get());
 
     registerMayBeVoidProperty(PROPERTY_TEXTLINECOLOR, PROPERTY_ID_TEXTLINECOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
-                    &m_aTextLineColor, ::cppu::UnoType<sal_Int32>::get());
+                    &m_aTextLineColor, cppu::UnoType<sal_Int32>::get());
 
     registerProperty(PROPERTY_TEXTEMPHASIS, PROPERTY_ID_TEXTEMPHASIS, PropertyAttribute::BOUND,
-                    &m_nFontEmphasis, ::getCppuType(&m_nFontEmphasis));
+                    &m_nFontEmphasis, cppu::UnoType<sal_Int16>::get());
 
     registerProperty(PROPERTY_TEXTRELIEF, PROPERTY_ID_TEXTRELIEF, PropertyAttribute::BOUND,
-                    &m_nFontRelief, ::getCppuType(&m_nFontRelief));
-
-    registerProperty(PROPERTY_FONTNAME,         PROPERTY_ID_FONTNAME,        PropertyAttribute::BOUND,&m_aFont.Name,            ::getCppuType(&m_aFont.Name));
-    registerProperty(PROPERTY_FONTHEIGHT,       PROPERTY_ID_FONTHEIGHT,      PropertyAttribute::BOUND,&m_aFont.Height,          ::getCppuType(&m_aFont.Height));
-    registerProperty(PROPERTY_FONTWIDTH,        PROPERTY_ID_FONTWIDTH,       PropertyAttribute::BOUND,&m_aFont.Width,           ::getCppuType(&m_aFont.Width));
-    registerProperty(PROPERTY_FONTSTYLENAME,    PROPERTY_ID_FONTSTYLENAME,   PropertyAttribute::BOUND,&m_aFont.StyleName,       ::getCppuType(&m_aFont.StyleName));
-    registerProperty(PROPERTY_FONTFAMILY,       PROPERTY_ID_FONTFAMILY,      PropertyAttribute::BOUND,&m_aFont.Family,          ::getCppuType(&m_aFont.Family));
-    registerProperty(PROPERTY_FONTCHARSET,      PROPERTY_ID_FONTCHARSET,     PropertyAttribute::BOUND,&m_aFont.CharSet,         ::getCppuType(&m_aFont.CharSet));
-    registerProperty(PROPERTY_FONTPITCH,        PROPERTY_ID_FONTPITCH,       PropertyAttribute::BOUND,&m_aFont.Pitch,           ::getCppuType(&m_aFont.Pitch));
-    registerProperty(PROPERTY_FONTCHARWIDTH,    PROPERTY_ID_FONTCHARWIDTH,   PropertyAttribute::BOUND,&m_aFont.CharacterWidth,  ::getCppuType(&m_aFont.CharacterWidth));
-    registerProperty(PROPERTY_FONTWEIGHT,       PROPERTY_ID_FONTWEIGHT,      PropertyAttribute::BOUND,&m_aFont.Weight,          ::getCppuType(&m_aFont.Weight));
-    registerProperty(PROPERTY_FONTSLANT,        PROPERTY_ID_FONTSLANT,       PropertyAttribute::BOUND,&m_aFont.Slant,           ::getCppuType(&m_aFont.Slant));
-    registerProperty(PROPERTY_FONTUNDERLINE,    PROPERTY_ID_FONTUNDERLINE,   PropertyAttribute::BOUND,&m_aFont.Underline,       ::getCppuType(&m_aFont.Underline));
-    registerProperty(PROPERTY_FONTSTRIKEOUT,    PROPERTY_ID_FONTSTRIKEOUT,   PropertyAttribute::BOUND,&m_aFont.Strikeout,       ::getCppuType(&m_aFont.Strikeout));
-    registerProperty(PROPERTY_FONTORIENTATION,  PROPERTY_ID_FONTORIENTATION, PropertyAttribute::BOUND,&m_aFont.Orientation,     ::getCppuType(&m_aFont.Orientation));
-    registerProperty(PROPERTY_FONTKERNING,      PROPERTY_ID_FONTKERNING,     PropertyAttribute::BOUND,&m_aFont.Kerning,         ::getCppuType(&m_aFont.Kerning));
-    registerProperty(PROPERTY_FONTWORDLINEMODE, PROPERTY_ID_FONTWORDLINEMODE,PropertyAttribute::BOUND,&m_aFont.WordLineMode,    ::getCppuType(&m_aFont.WordLineMode));
-    registerProperty(PROPERTY_FONTTYPE,         PROPERTY_ID_FONTTYPE,        PropertyAttribute::BOUND,&m_aFont.Type,            ::getCppuType(&m_aFont.Type));
+                    &m_nFontRelief, cppu::UnoType<sal_Int16>::get());
+
+    registerProperty(PROPERTY_FONTNAME,         PROPERTY_ID_FONTNAME,        PropertyAttribute::BOUND,&m_aFont.Name, cppu::UnoType<OUString>::get());
+    registerProperty(PROPERTY_FONTHEIGHT,       PROPERTY_ID_FONTHEIGHT,      PropertyAttribute::BOUND,&m_aFont.Height, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTWIDTH,        PROPERTY_ID_FONTWIDTH,       PropertyAttribute::BOUND,&m_aFont.Width, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTSTYLENAME,    PROPERTY_ID_FONTSTYLENAME,   PropertyAttribute::BOUND,&m_aFont.StyleName, cppu::UnoType<OUString>::get());
+    registerProperty(PROPERTY_FONTFAMILY,       PROPERTY_ID_FONTFAMILY,      PropertyAttribute::BOUND,&m_aFont.Family, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTCHARSET,      PROPERTY_ID_FONTCHARSET,     PropertyAttribute::BOUND,&m_aFont.CharSet, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTPITCH,        PROPERTY_ID_FONTPITCH,       PropertyAttribute::BOUND,&m_aFont.Pitch, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTCHARWIDTH,    PROPERTY_ID_FONTCHARWIDTH,   PropertyAttribute::BOUND,&m_aFont.CharacterWidth, cppu::UnoType<float>::get());
+    registerProperty(PROPERTY_FONTWEIGHT,       PROPERTY_ID_FONTWEIGHT,      PropertyAttribute::BOUND,&m_aFont.Weight, cppu::UnoType<float>::get());
+    registerProperty(PROPERTY_FONTSLANT,        PROPERTY_ID_FONTSLANT,       PropertyAttribute::BOUND,&m_aFont.Slant, cppu::UnoType<css::awt::FontSlant>::get());
+    registerProperty(PROPERTY_FONTUNDERLINE,    PROPERTY_ID_FONTUNDERLINE,   PropertyAttribute::BOUND,&m_aFont.Underline, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTSTRIKEOUT,    PROPERTY_ID_FONTSTRIKEOUT,   PropertyAttribute::BOUND,&m_aFont.Strikeout, cppu::UnoType<sal_Int16>::get());
+    registerProperty(PROPERTY_FONTORIENTATION,  PROPERTY_ID_FONTORIENTATION, PropertyAttribute::BOUND,&m_aFont.Orientation, cppu::UnoType<float>::get());
+    registerProperty(PROPERTY_FONTKERNING,      PROPERTY_ID_FONTKERNING,     PropertyAttribute::BOUND,&m_aFont.Kerning, cppu::UnoType<sal_Bool>::get());
+    registerProperty(PROPERTY_FONTWORDLINEMODE, PROPERTY_ID_FONTWORDLINEMODE,PropertyAttribute::BOUND,&m_aFont.WordLineMode, cppu::UnoType<sal_Bool>::get());
+    registerProperty(PROPERTY_FONTTYPE,         PROPERTY_ID_FONTTYPE,        PropertyAttribute::BOUND,&m_aFont.Type, cppu::UnoType<sal_Int16>::get());
 
     refreshColumns();
 }
commit 04263067ceee7b48f2782e5fdcc515c9d447ff5a
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed May 28 22:30:41 2014 +0300

    This needs to be debugged and understood, not just randomly "fixed"
    
    This reverts commit 72827968e606adcdf8c16e5381b887180975ae46.
    
    Change-Id: Ie79bb1d57d05c0a1e51733bacc1b103f44ddc153

diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index 562f42c..606b9a6 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -59,9 +59,7 @@ SfxListener::~SfxListener()
 
 void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBroadcaster )
 {
-    SfxBroadcasterArr_Impl::iterator aIter = std::find( aBCs.begin(), aBCs.end(), &rBroadcaster );
-    if ( aIter != aBCs.end() )
-        aBCs.erase( aIter );
+    aBCs.erase( std::find( aBCs.begin(), aBCs.end(), &rBroadcaster ) );
 }
 
 
commit 2574a22a5be7f4cbc995c3fd0f22c8cc2a551c9a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed May 28 21:22:33 2014 +0200

    writerfilter: remove unused analyzestage3.xsl
    
    Change-Id: I2e6b04f32bd0aca6da41e04e26f33bd894c53d7e

diff --git a/writerfilter/source/ooxml/analyzestage3.xsl b/writerfilter/source/ooxml/analyzestage3.xsl
deleted file mode 100644
index e01e976..0000000
--- a/writerfilter/source/ooxml/analyzestage3.xsl
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
--->
-
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:key name="qnames" match="/stage2/qnames/qname" use="@qname"/>
-
-<xsl:template match="/">
-	<stage3 xmlns:rng="http://relaxng.org/ns/structure/1.0">
-	<xsl:for-each select="/stage2/analyze">
-		<xsl:for-each select="attribute|element">
-			<xsl:variable name="qname" select="@qname"/>
-			<xsl:copy>
-				<xsl:copy-of select="@*"/>
-					<xsl:for-each select="key('qnames', @qname)">
-						<file>
-							<xsl:attribute name="name">
-								<xsl:value-of select="@file"/>
-							</xsl:attribute>
-							<xsl:attribute name="line">
-								<xsl:value-of select="@line"/>
-							</xsl:attribute>
-                            <xsl:for-each select="ancestor::qnames/status|ancestor::qnames/nostatus">
-                                <xsl:copy>
-                                    <xsl:copy-of select="@*"/>
-                                    <xsl:attribute name="qname-count">
-                                        <xsl:value-of select="count(ancestor::qnames/qname)"/>
-                                    </xsl:attribute>
-                                </xsl:copy>
-                            </xsl:for-each>
-						</file>
-					</xsl:for-each>
-			</xsl:copy>
-		</xsl:for-each>
-	</xsl:for-each>
-	</stage3>
-</xsl:template>
-
-</xsl:stylesheet>	
\ No newline at end of file
commit db3c6265cf355f88e6a746db7df17f13d2ab5885
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed May 28 20:07:57 2014 +0200

    chart2: fix namespacing
    
    Change-Id: Ib9ef14b4ce38f93f590473913a308a967343c75d

diff --git a/chart2/source/view/main/DummyXShape.hxx b/chart2/source/view/main/DummyXShape.hxx
index 11aa9fa..779247b 100644
--- a/chart2/source/view/main/DummyXShape.hxx
+++ b/chart2/source/view/main/DummyXShape.hxx
@@ -62,8 +62,6 @@
 #include <map>
 #include <boost/unordered_map.hpp>
 
-using namespace com::sun::star;
-
 
 namespace chart {
 
@@ -175,7 +173,7 @@ public:
 
 protected:
 
-    std::map<OUString, uno::Any> maProperties;
+    std::map<OUString, css::uno::Any> maProperties;
     com::sun::star::awt::Point maPosition;
     com::sun::star::awt::Size maSize;
 
@@ -189,29 +187,29 @@ private:
 class DummyCube : public DummyXShape
 {
 public:
-    DummyCube(const drawing::Position3D &rPos, const drawing::Direction3D& rSize,
-            const uno::Reference< beans::XPropertySet > & xPropSet,
+    DummyCube(const css::drawing::Position3D &rPos, const css::drawing::Direction3D& rSize,
+            const css::uno::Reference< css::beans::XPropertySet > & xPropSet,
             const tPropertyNameMap& rPropertyNameMap );
 };
 
 class DummyCylinder : public DummyXShape
 {
 public:
-    DummyCylinder(const drawing::Position3D&, const drawing::Direction3D& rSize );
+    DummyCylinder(const css::drawing::Position3D&, const css::drawing::Direction3D& rSize );
 };
 
 class DummyPyramid : public DummyXShape
 {
 public:
-    DummyPyramid(const drawing::Position3D& rPosition, const drawing::Direction3D& rSize,
-            const uno::Reference< beans::XPropertySet > & xPropSet,
+    DummyPyramid(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize,
+            const css::uno::Reference< css::beans::XPropertySet > & xPropSet,
             const tPropertyNameMap& rPropertyNameMap );
 };
 
 class DummyCone : public DummyXShape
 {
 public:
-    DummyCone(const drawing::Position3D& rPosition, const drawing::Direction3D& rSize);
+    DummyCone(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize);
 };
 
 class DummyPieSegment2D : public DummyXShape
@@ -219,7 +217,7 @@ class DummyPieSegment2D : public DummyXShape
 public:
     DummyPieSegment2D(double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree,
             double fUnitCircleInnerRadius, double fUnitCircleOuterRadius,
-            const drawing::Direction3D& rOffset, const drawing::HomogenMatrix& rUnitCircleToScene);
+            const css::drawing::Direction3D& rOffset, const css::drawing::HomogenMatrix& rUnitCircleToScene);
     void render() SAL_OVERRIDE;
 private:
     double mfUnitCircleStartAngleDegree;
@@ -227,25 +225,25 @@ private:
     double mfUnitCircleInnerRadius;
     double mfUnitCircleOuterRadius;
 
-    drawing::Direction3D maOffset;
-    drawing::HomogenMatrix maUnitCircleToScene;
+    css::drawing::Direction3D maOffset;
+    css::drawing::HomogenMatrix maUnitCircleToScene;
 };
 
 class DummyPieSegment : public DummyXShape
 {
 public:
     DummyPieSegment(
-            const drawing::Direction3D& rOffset, const drawing::HomogenMatrix& rUnitCircleToScene);
+            const css::drawing::Direction3D& rOffset, const css::drawing::HomogenMatrix& rUnitCircleToScene);
 
 private:
-    drawing::Direction3D maOffset;
-    drawing::HomogenMatrix maUnitCircleToScene;
+    css::drawing::Direction3D maOffset;
+    css::drawing::HomogenMatrix maUnitCircleToScene;
 };
 
 class DummyStripe : public DummyXShape
 {
 public:
-    DummyStripe(const Stripe& rStripe, const uno::Reference< beans::XPropertySet > & xPropSet,
+    DummyStripe(const Stripe& rStripe, const css::uno::Reference< css::beans::XPropertySet > & xPropSet,
             const tPropertyNameMap& rPropertyNameMap );
 
 private:
@@ -255,32 +253,32 @@ private:
 class DummyArea3D : public DummyXShape
 {
 public:
-    DummyArea3D(const drawing::PolyPolygonShape3D& rShape);
+    DummyArea3D(const css::drawing::PolyPolygonShape3D& rShape);
 
 private:
-    drawing::PolyPolygonShape3D maShapes;
+    css::drawing::PolyPolygonShape3D maShapes;
 };
 
 class DummyArea2D : public DummyXShape
 {
 public:
-    DummyArea2D(const drawing::PointSequenceSequence& rShape);
+    DummyArea2D(const css::drawing::PointSequenceSequence& rShape);
 
     virtual void render() SAL_OVERRIDE;
 
 private:
-    drawing::PointSequenceSequence maShapes;
+    css::drawing::PointSequenceSequence maShapes;
 };
 
 class DummySymbol2D : public DummyXShape
 {
 public:
-    DummySymbol2D(const drawing::Position3D& rPosition, const drawing::Direction3D& rSize,
+    DummySymbol2D(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize,
             sal_Int32 nStandardSymbol, sal_Int32 nFillColor);
     void render() SAL_OVERRIDE;
 private:
-    drawing::Position3D mrPosition;
-    drawing::Direction3D mrSize;
+    css::drawing::Position3D mrPosition;
+    css::drawing::Direction3D mrSize;
     sal_Int32 mnStandardSymbol;
     sal_Int32 mnFillColor;
 };
@@ -288,17 +286,17 @@ private:
 class DummyGraphic2D : public DummyXShape
 {
 public:
-    DummyGraphic2D(const drawing::Position3D& rPosition, const drawing::Direction3D& rSize,
-            const uno::Reference< graphic::XGraphic > xGraphic );
+    DummyGraphic2D(const css::drawing::Position3D& rPosition, const css::drawing::Direction3D& rSize,
+            const css::uno::Reference< css::graphic::XGraphic > xGraphic );
 
 private:
-    uno::Reference< graphic::XGraphic > mxGraphic;
+    css::uno::Reference< css::graphic::XGraphic > mxGraphic;
 };
 
 class DummyCircle : public DummyXShape
 {
 public:
-    DummyCircle(const awt::Point& rPosition, const awt::Size& rSize);
+    DummyCircle(const css::awt::Point& rPosition, const css::awt::Size& rSize);
 
     virtual void render() SAL_OVERRIDE;
 };
@@ -306,30 +304,30 @@ public:
 class DummyLine3D : public DummyXShape
 {
 public:
-    DummyLine3D(const drawing::PolyPolygonShape3D& rPoints, const VLineProperties& rProperties);
+    DummyLine3D(const css::drawing::PolyPolygonShape3D& rPoints, const VLineProperties& rProperties);
 
 private:
-    drawing::PolyPolygonShape3D maPoints;
+    css::drawing::PolyPolygonShape3D maPoints;
 };
 
 class DummyLine2D : public DummyXShape
 {
 public:
-    DummyLine2D(const drawing::PointSequenceSequence& rPoints, const VLineProperties* pProperties);
-    DummyLine2D(const awt::Size& rSize, const awt::Point& rPosition);
+    DummyLine2D(const css::drawing::PointSequenceSequence& rPoints, const VLineProperties* pProperties);
+    DummyLine2D(const css::awt::Size& rSize, const css::awt::Point& rPosition);
 
     virtual void render() SAL_OVERRIDE;
 
 private:
-    drawing::PointSequenceSequence maPoints;
+    css::drawing::PointSequenceSequence maPoints;
 };
 
 class DummyRectangle : public DummyXShape
 {
 public:
     DummyRectangle();
-    DummyRectangle(const awt::Size& rSize);
-    DummyRectangle(const awt::Size& rSize, const awt::Point& rPoint, const tNameSequence& rNames,
+    DummyRectangle(const css::awt::Size& rSize);
+    DummyRectangle(const css::awt::Size& rSize, const css::awt::Point& rPoint, const tNameSequence& rNames,
             const tAnySequence& rValues );
 
     virtual void render() SAL_OVERRIDE;
@@ -339,7 +337,7 @@ class DummyText : public DummyXShape
 {
 public:
     DummyText(const OUString& rText, const tNameSequence& rNames,
-            const tAnySequence& rValues, const uno::Any& rTrans, com::sun::star::uno::Reference<
+            const tAnySequence& rValues, const css::uno::Any& rTrans, com::sun::star::uno::Reference<
             com::sun::star::drawing::XShapes > xTarget, double nRotation);
 
     virtual void render() SAL_OVERRIDE;
@@ -352,7 +350,7 @@ private:
     void setTransformatAsProperty(const com::sun::star::drawing::HomogenMatrix3& rMatrix);
 
     OUString maText;
-    uno::Any maTrans;
+    css::uno::Any maTrans;
     BitmapEx maBitmap;
     double mnRotation;
 };
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index fdb93b8..038b5fc 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -28,9 +28,6 @@
 #define DEBUG_POSITIONING 0
 #define RENDER_TO_FILE 0
 
-using namespace std;
-using namespace ::com::sun::star;
-
 struct PosVecf3
 {
     float x;
@@ -64,9 +61,9 @@ struct TextInfo
     float nDy;
 };
 
-typedef vector<GLfloat> Area2DPointList;
-typedef vector<GLfloat> PieSegment2DPointList;
-typedef vector<GLfloat> PointList;
+typedef std::vector<GLfloat> Area2DPointList;
+typedef std::vector<GLfloat> PieSegment2DPointList;
+typedef std::vector<GLfloat> PointList;
 
 // for 3D, use vector to save the points
 
@@ -99,14 +96,14 @@ public:
 
     int CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixels,
                           const ::Size &aPixelSize,
-                          const ::css::awt::Point&,
-                          const ::css::awt::Size& aSize,
+                          const css::awt::Point&,
+                          const css::awt::Size& aSize,
                           long rotation,
-                          const ::css::drawing::HomogenMatrix3& rTrans);
+                          const css::drawing::HomogenMatrix3& rTrans);
     int CreateTextTexture(const BitmapEx& rBitmapEx,
-            const ::css::awt::Point& aPos, const css::awt::Size& aSize,
-            long rotation, const ::css::drawing::HomogenMatrix3& rTrans);
-    int CreateTextTexture(::rtl::OUString const &textValue, Font aFont, long fontColor, awt::Point aPos, awt::Size aSize, long rotation);
+            const css::awt::Point& aPos, const css::awt::Size& aSize,
+            long rotation, const css::drawing::HomogenMatrix3& rTrans);
+    int CreateTextTexture(::rtl::OUString const &textValue, Font aFont, long fontColor, css::awt::Point aPos, css::awt::Size aSize, long rotation);
     int RenderTextShape();
 
     int SetArea2DShapePoint(float x, float y, int listLength);
commit b41504503cdf4ac562f82e668bf2fe9217260493
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed May 28 20:30:36 2014 +0200

    Related fdo#75971 Crash when invoking "Insert > Names > Create"
    
    bt:
    0x00002aaac837cd3c in rtl::OUString::copy (this=0x7ffffffec760, beginIndex=-2147483595) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:1464
    0x00002aaac87604ea in ScInterpreter::ScRight (this=0x8a6b7a0) at /home/julien/compile-libreoffice/libreoffice/sc/source/core/tool/interpr1.cxx:8106
    0x00002aaac879be5c in ScInterpreter::Interpret (this=0x8a6b7a0) at /home/julien/compile-libreoffice/libreoffice/sc/source/core/tool/interpr4.cxx:4150
    
    So apply similar fix http://cgit.freedesktop.org/libreoffice/core/commit/?id=37d7d115dd346ba7a713a5a18d90fc48a0d35072
    to scRight
    
    Change-Id: I576e82cd033f0e0e5f9e9cbb9dd5f569782bbbc4

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 9223dc6..bae7962 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8091,7 +8091,7 @@ void ScInterpreter::ScRight()
         if (nParamCount == 2)
         {
             double nVal = ::rtl::math::approxFloor(GetDouble());
-            if ( nVal < 0.0 || nVal > SAL_MAX_UINT16 )
+            if ( rtl::math::isNan(nVal) || nVal < 0.0 || nVal > SAL_MAX_UINT16 )
             {
                 PushIllegalArgument();
                 return ;
commit 2e2d7d8b6ff25524ce92430bfd7a5365569c853c
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue May 27 21:58:31 2014 +0100

    Add a grey gradient background to the 3D chartm and tweak text color.
    
    Conflicts:
    	chart2/source/view/main/GL3DRenderer.cxx
    
    Change-Id: I8b74a1e7f32c30b6a908c0870bbeacc00cdea444

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 20fbca9..a0036ed 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -190,6 +190,7 @@ public:
 private:
     void MoveModelf(PosVecf3& trans,PosVecf3& angle,PosVecf3& scale);
 
+    void ClearBuffer();
     void RenderPolygon3DObject();
     void RenderLine3D(Polygon3DInfo &polygon);
     void RenderPolygon3D(Polygon3DInfo &polygon);
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 2573191..1cf0b49 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -77,7 +77,11 @@ const TextCacheItem& TextCache::getText(OUString const & rText)
     VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
     Font aFont = aDevice.GetFont();
     aFont.SetSize(Size(0, 96));
-    aFont.SetColor(COL_BLACK);
+    static bool bOldRender = getenv("OLDRENDER");
+    if (bOldRender)
+        aFont.SetColor(COL_BLACK);
+    else
+        aFont.SetColor(COL_GREEN); // RGB_COLORDATA(0xf0, 0xf0, 0xf0));
     aDevice.SetFont(aFont);
     aDevice.Erase();
 
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index aded984..af5238b 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -253,10 +253,7 @@ void OpenGL3DRenderer::init()
 
     glEnable(GL_MULTISAMPLE);
 
-    glClearColor (1.0, 1.0, 1.0, 1.0);
-    glClear(GL_COLOR_BUFFER_BIT);
-    glClearDepth(1.0f);
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+    ClearBuffer();
 
     glGenBuffers(1, &m_CubeVertexBuf);
     glGenBuffers(1, &m_CubeNormalBuf);
@@ -1693,12 +1690,42 @@ void OpenGL3DRenderer::CreateSceneBoxView()
                m_CameraInfo.cameraUp);
 }
 
+void OpenGL3DRenderer::ClearBuffer()
+{
+    static bool bOldRender = getenv("OLDRENDER");
+    if (!bOldRender) // gradient background
+    {
+        glDisable(GL_DEPTH_TEST);
+        glDisable(GL_LIGHTING);
+
+        glClearDepth(1.0f);
+        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+        glBegin (GL_QUADS);
+        glColor3f(0.3,0.3,0.3);
+        glVertex3f (-1.0f, -1.0f, -1.0f);
+        glVertex3f (1.0f, -1.0f, -1.0f);
+
+        glColor3f(0.0,0.0,0.0);
+        glVertex3f (1.0f, 1.0f, -1.0f);
+        glVertex3f (-1.0f, 1.0f, -1.0f);
+        glEnd ();
+
+        glEnable(GL_LIGHTING);
+        glEnable(GL_DEPTH_TEST);
+    }
+    else
+    {
+        glClearDepth(1.0f);
+        glClearColor (1.0, 0.5, 0.5, 1.0);
+        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+    }
+}
+
 void OpenGL3DRenderer::ProcessUnrenderedShape(bool bNewScene)
 {
     glViewport(0, 0, m_iWidth, m_iHeight);
-    glClearDepth(1.0f);
-    glClearColor(1.0, 1.0, 1.0, 1.0);
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+    ClearBuffer();
     CreateSceneBoxView();
     //Polygon
     RenderPolygon3DObject();
commit 538c13f3d1756f2d105115f64ab1bc0b7426eebc
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Wed May 28 18:43:37 2014 +0100

    fdo#78801 fdo#52547 Paste preference is image, then html, then text.
    
    c47db038f98aaf7aec3cbe57c4e5683591afa23e was an attempt to fix fdo#52547,
    i.e. to make sure that the actual image data was stored if an image was
    being pasted from a browser (where the clipboard contains both image data,
    but also an html construct which would instead embed the image from the
    web). However the new ordering inadvertently meant that strings would
    be preferred to html -- i.e. copying a mixture of text+image from a
    webpage would result in only the text being stored.
    
    The new ordering causes images copied from the browser to still have
    the actual image data stored (rather than a link in the case of the
    html being stored), but html is still preferred to plaint text.
    
    (This is primarily as a result of Firefox (and possibly other browsers)
    changing their clipboard to contain an html construct which links to the
    original image, in addition to the raw image data-- and html previously
    being preferred to images in the paste ordering meant that the linked
    version would be pasted by default, which is not the expected result
    when copying an image.)
    
    Change-Id: Ice9b37cf3dd25d8cdb0e04f19a6b2f3661018564

diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index 36716a3..753e738 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -857,20 +857,20 @@ static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Copy[] =  \
         { SOT_FORMATSTR_ID_SD_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_EMBED_SOURCE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },     \
         { SOT_FORMATSTR_ID_EMBEDDED_OBJ, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },     \
+        { SOT_FORMAT_GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_PNG, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMAT_BITMAP, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_HTML, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMAT_RTF, EXCHG_IN_ACTION_COPY | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },                           \
         { SOT_FORMATSTR_ID_NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },          \
         { SOT_FORMAT_STRING, EXCHG_OUT_ACTION_INSERT_STRING | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },              \
         { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\
         { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMAT_GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMATSTR_ID_PNG, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMAT_BITMAP, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
         { SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
-        { SOT_FORMATSTR_ID_HTML, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMATSTR_ID_HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMATSTR_ID_HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_LINK, EXCHG_OUT_ACTION_INSERT_DDE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },             \
         { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },        \
         { 0xffff, 0, 0 }                                                          \
@@ -1036,18 +1036,18 @@ static SotAction_Impl const aEXCHG_DEST_SCDOC_FREE_AREA_Copy[] =  \
         { SOT_FORMATSTR_ID_EMBEDDED_OBJ, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },     \
         { SOT_FORMATSTR_ID_BIFF_5, EXCHG_IN_ACTION_COPY | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },                  \
         { SOT_FORMATSTR_ID_BIFF__5,EXCHG_IN_ACTION_COPY | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },                  \
-        { SOT_FORMAT_STRING, EXCHG_OUT_ACTION_INSERT_STRING | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },              \
-        { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\
-        { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMAT_GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_PNG, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMAT_BITMAP, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
-        { SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
         { SOT_FORMATSTR_ID_HTML, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMAT_STRING, EXCHG_OUT_ACTION_INSERT_STRING | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },              \
+        { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\
+        { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
+        { SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
         { SOT_FORMATSTR_ID_LINK, EXCHG_OUT_ACTION_INSERT_DDE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },             \
         { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },        \
         { SOT_FORMATSTR_ID_BIFF_8, EXCHG_IN_ACTION_COPY | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },                  \
@@ -1126,18 +1126,18 @@ static SotAction_Impl const aEXCHG_DEST_SDDOC_FREE_AREA_Copy[] =  \
         { SOT_FORMATSTR_ID_SD_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_EMBED_SOURCE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },     \
         { SOT_FORMATSTR_ID_EMBEDDED_OBJ, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },     \
-        { SOT_FORMAT_STRING, EXCHG_OUT_ACTION_INSERT_STRING | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },              \
-        { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-        { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\
-        { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMAT_GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_PNG, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMAT_BITMAP, EXCHG_OUT_ACTION_INSERT_BITMAP | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
-          { SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
-          { SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
         { SOT_FORMATSTR_ID_HTML, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
         { SOT_FORMATSTR_ID_HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMAT_STRING, EXCHG_OUT_ACTION_INSERT_STRING | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },              \
+        { SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, FILEGRPDSC_ONLY_URL },\
+        { SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, EXCHG_OUT_ACTION_INSERT_HYPERLINK | EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },\
+        { SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
+        { SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, EXCHG_OUT_ACTION_INSERT_OLE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 }, \
         { SOT_FORMATSTR_ID_LINK, EXCHG_OUT_ACTION_INSERT_DDE | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },             \
         { SOT_FORMATSTR_ID_SVIM, EXCHG_OUT_ACTION_INSERT_IMAGEMAP | EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL, 0 },        \
         { 0xffff, 0, 0 }                                                          \
commit 5695cdfdc0ab372181ff9ad63db08320fb4e70c9
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 19:29:54 2014 +0200

    change the bar direction for the demo
    
    Change-Id: I24e45810cb154310d8e35982e2ef100cf5746e2b

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index b129b9f..711072c 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -103,8 +103,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     // guarantee they are positioned correctly.  In fact, they are guaranteed
     // to be positioned incorrectly.
 
-    const float nBarSizeX = 5.0f;
-    const float nBarSizeY = 30.0f;
+    const float nBarSizeX = 30.0f;
+    const float nBarSizeY = 5.0f;
     const float nBarDistanceX = 5.0f;
     const float nBarDistanceY = 5.0;
 
@@ -153,9 +153,9 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back());
             glm::vec3 aTopLeft, aTopRight, aBottomRight;
             aTopRight.x = -nBarDistanceY;
-            aTopRight.y = nYPos + 0.25 * nBarSizeY;
+            aTopRight.y = nYPos + nBarDistanceY;
             aTopLeft.x = calculateTextWidth(aSeriesName) * -1.0 - nBarDistanceY;
-            aTopLeft.y = nYPos + 0.25 * nBarSizeY;
+            aTopLeft.y = nYPos + nBarDistanceY;
             aBottomRight = aTopRight;
             aBottomRight.y -= TEXT_HEIGHT;
             p->setPosition(aTopLeft, aTopRight, aBottomRight);
commit a8b7fcf34914df128e9664bbd70dc269c7cf32cb
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 19:11:47 2014 +0200

    prevent generating repeated information in rendering
    
    Change-Id: I1cc5453af6cabe7736cc43e13aad280aaf2c62f6

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index bc1caee..b129b9f 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -296,8 +296,8 @@ void GL3DBarChart::render()
     {
         mpCamera->render();
     }
+    mpRenderer->ProcessUnrenderedShape(mbNeedsNewRender);
     mbNeedsNewRender = false;
-    mpRenderer->ProcessUnrenderedShape();
     mrWindow.getContext()->swapBuffers();
 }
 
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 4e85568..20fbca9 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -179,7 +179,7 @@ public:
 
                                  glm::vec2 vTopLeft, glm::vec2 vBottomRight,
                                  sal_uInt32 nUniqueId);
-    void ProcessUnrenderedShape();
+    void ProcessUnrenderedShape(bool bNewScene);
 
     void SetPickingMode(bool bPickingMode);
 
@@ -231,7 +231,7 @@ private:
     void GetBatchMiddleInfo(Extrude3DInfo &extrude3D);
     void InitBatch3DUniformBlock();
     void UpdateBatch3DUniformBlock();
-    void RenderBatchBars();
+    void RenderBatchBars(bool bNewScene);
 private:
 
     struct ShaderResources
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index ae987ae..aded984 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1693,7 +1693,7 @@ void OpenGL3DRenderer::CreateSceneBoxView()
                m_CameraInfo.cameraUp);
 }
 
-void OpenGL3DRenderer::ProcessUnrenderedShape()
+void OpenGL3DRenderer::ProcessUnrenderedShape(bool bNewScene)
 {
     glViewport(0, 0, m_iWidth, m_iHeight);
     glClearDepth(1.0f);
@@ -1706,7 +1706,7 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
     if(mbPickingMode)
         RenderExtrude3DObject();
     else
-        RenderBatchBars();
+        RenderBatchBars(bNewScene);
     //render text
     RenderTextShape();
     // render screen text
@@ -1865,9 +1865,10 @@ void OpenGL3DRenderer::GetBatchBarsInfo()
     }
 }
 
-void OpenGL3DRenderer::RenderBatchBars()
+void OpenGL3DRenderer::RenderBatchBars(bool bNewScene)
 {
-    GetBatchBarsInfo();
+    if(bNewScene)
+        GetBatchBarsInfo();
     glEnable(GL_DEPTH_TEST);
     glEnable(GL_CULL_FACE);
     glCullFace(GL_BACK);
commit a45b16602f4d167d1cccfa285dd0c49a6c9d7c45
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 18:51:38 2014 +0200

    avoid transferring the textures for each frame
    
    Change-Id: I79466e66dc18dbbf72f192fe44d05fb6d657fa34

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 1bb558e..bc1caee 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -35,7 +35,8 @@ GL3DBarChart::GL3DBarChart(
     mnStep(0),
     mnStepsTotal(0),
     mnCornerId(0),
-    mbBlockUserInput(false)
+    mbBlockUserInput(false),
+    mbNeedsNewRender(true)
 {
     Size aSize = mrWindow.GetSizePixel();
     mpRenderer->SetSize(aSize);
@@ -93,6 +94,7 @@ double findMaxValue(const boost::ptr_vector<VDataSeries>& rDataSeriesContainer)
 void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSeriesContainer,
         ExplicitCategoriesProvider& rCatProvider)
 {
+    mpRenderer->ReleaseShapes();
     // Each series of data flows from left to right, and multiple series are
     // stacked vertically along y axis.
 
@@ -269,6 +271,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     mpCamera->setPosition(maCameraPosition);
     maCameraDirection = glm::vec3(mnMaxX/2, mnMaxY/2, 0);
     mpCamera->setDirection(maCameraDirection);
+
+    mbNeedsNewRender = true;
 }
 
 void GL3DBarChart::render()
@@ -280,11 +284,19 @@ void GL3DBarChart::render()
     Size aSize = mrWindow.GetSizePixel();
     mpRenderer->SetSize(aSize);
     mrWindow.getContext()->setWinSize(aSize);
-    for(boost::ptr_vector<opengl3D::Renderable3DObject>::iterator itr = maShapes.begin(),
-            itrEnd = maShapes.end(); itr != itrEnd; ++itr)
+    if(mbNeedsNewRender)
+    {
+        for(boost::ptr_vector<opengl3D::Renderable3DObject>::iterator itr = maShapes.begin(),
+                itrEnd = maShapes.end(); itr != itrEnd; ++itr)
+        {
+            itr->render();
+        }
+    }
+    else
     {
-        itr->render();
+        mpCamera->render();
     }
+    mbNeedsNewRender = false;
     mpRenderer->ProcessUnrenderedShape();
     mrWindow.getContext()->swapBuffers();
 }
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index de92660..8c97ca8 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -105,6 +105,7 @@ private:
 
     std::map<sal_uInt32, const BarInformation> maBarMap;
     bool mbBlockUserInput;
+    bool mbNeedsNewRender;
 };
 
 }
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index f16340d..4e85568 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -184,6 +184,9 @@ public:
     void SetPickingMode(bool bPickingMode);
 
     sal_uInt32 GetPixelColorFromPoint(long nX, long nY);
+
+    void ReleaseShapes();
+    void ReleaseScreenTextShapes();
 private:
     void MoveModelf(PosVecf3& trans,PosVecf3& angle,PosVecf3& scale);
 
@@ -219,11 +222,9 @@ private:
                                int iSubDivZ, float width, float height, float depth);
     void CreateSceneBoxView();
 
-    void ReleaseShapes();
     void ReleasePolygonShapes();
     void ReleaseExtrude3DShapes();
     void ReleaseTextShapes();
-    void ReleaseScreenTextShapes();
     void ReleaseBatchBarInfo();
     void GetBatchBarsInfo();
     void GetBatchTopAndFlatInfo(Extrude3DInfo &extrude3D);
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index a6605a8..ae987ae 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1711,7 +1711,6 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
     RenderTextShape();
     // render screen text
     RenderScreenTextShape();
-    ReleaseShapes();
 #if DEBUG_FBO
     OUString aFileName = OUString("D://shaderout_") + OUString::number(m_iWidth) + "_" + OUString::number(m_iHeight) + ".png";
     OpenGLHelper::renderToFile(m_iWidth, m_iHeight, aFileName);
@@ -1762,7 +1761,6 @@ void OpenGL3DRenderer::ReleaseBatchBarInfo()
     }
 }
 
-
 void OpenGL3DRenderer::ReleaseShapes()
 {
     ReleasePolygonShapes();
commit 8287ee51e91899bf2eac35b0eee567998cc99a25
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 18:32:16 2014 +0200

    fix picking mode for the batch rendering
    
    Change-Id: I9bfe64d56f9217561bb059eacde1fa3ece5f2cc1

diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index d0ada46..a6605a8 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1703,8 +1703,10 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
     //Polygon
     RenderPolygon3DObject();
     //Shape3DExtrudeObject
-    RenderBatchBars();
-//    RenderExtrude3DObject();
+    if(mbPickingMode)
+        RenderExtrude3DObject();
+    else
+        RenderBatchBars();
     //render text
     RenderTextShape();
     // render screen text
commit 3827c502946b60f314ef2fe566b990732dc7cd26
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed May 28 18:28:59 2014 +0200

    remove unnecessary glFinish
    
    Change-Id: I368e045a7635410a94f2f3a794e1c75a39418520

diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 987c5e6..d0ada46 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1965,7 +1965,6 @@ void OpenGL3DRenderer::RenderBatchBars()
         glDisableVertexAttribArray(maResources.m_3DBatchNormalMatrixID + i);
         glVertexAttribDivisor(maResources.m_3DBatchNormalMatrixID + i, 0);
     }
-    glFinish();
     glUseProgram(0);
     glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
     glDisable(GL_CULL_FACE);
commit 6d1598c30e99a951d635b53cb52af12e9a6c94b7
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed May 28 20:53:07 2014 +0800

    Modify the bar generate function
    
    Conflicts:
    	chart2/source/view/main/GL3DRenderer.cxx
    
    Change-Id: Ia323c54b9113be15f01bff2a2f1e66da8ebfc39c

diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index a031ab1..987c5e6 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -299,6 +299,7 @@ void OpenGL3DRenderer::init()
 
     OpenGLHelper::createFramebuffer(m_iWidth, m_iHeight, mnPickingFbo, mnPickingRboDepth, mnPickingRboColor);
 
+    m_Extrude3DInfo.rounded = false;
     CHECK_GL_ERROR();
     Init3DUniformBlock();
     InitBatch3DUniformBlock();
@@ -378,10 +379,6 @@ void OpenGL3DRenderer::SetVertex(PackedVertex &packed,
 
 void OpenGL3DRenderer::CreateActualRoundedCube(float fRadius, int iSubDivY, int iSubDivZ, float width, float height, float depth)
 {
-    if ((fRadius > (width / 2)) || (fRadius > (height / 2)) || (fRadius > (depth / 2)))
-    {
-        return;
-    }
     float topThreshold = depth - 2 * fRadius;
     float bottomThreshold = fRadius;
 
@@ -1033,12 +1030,14 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC
     m_Extrude3DInfo.xTransform = tranform.x;
     m_Extrude3DInfo.yTransform = tranform.y;
     m_Extrude3DInfo.zTransform = tranform.z;
-    m_Extrude3DInfo.rounded = roundedCorner;
-    if (m_Extrude3DInfo.rounded && (m_RoundBarMesh.iMeshSizes == 0))
-    {
-        float radius = 0.2f;
-        CreateActualRoundedCube(radius, CORNER_DIVION_Y, CORNER_DIVION_Z,
-                1.0f, m_Extrude3DInfo.yScale / m_Extrude3DInfo.xScale, 1 + 2 * radius);
+    float width = 1.0f;
+    float height = m_Extrude3DInfo.yScale / m_Extrude3DInfo.xScale;
+    float radius = height > 0.2f ? 0.2f : height / 4.0f;
+    float depth = 1 + 2 * radius;
+    bool NORoundedCube = (radius > (width / 2)) || (radius > (height / 2)) || (radius > (depth / 2));
+    if (!NORoundedCube && roundedCorner && (m_RoundBarMesh.iMeshSizes == 0))
+    {
+        CreateActualRoundedCube(radius, CORNER_DIVION_Y, CORNER_DIVION_Z, width, height, depth);
         AddVertexData(m_CubeVertexBuf);
         AddNormalData(m_CubeNormalBuf);
         AddIndexData(m_CubeElementBuf);
@@ -1050,6 +1049,7 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC
         m_Vertices.clear();
         m_Normals.clear();
         m_Indices.clear();
+        m_Extrude3DInfo.rounded = true;
     }
     m_Batchmaterial = m_Extrude3DInfo.material;
 }
@@ -1871,7 +1871,6 @@ void OpenGL3DRenderer::RenderBatchBars()
     glEnable(GL_DEPTH_TEST);
     glEnable(GL_CULL_FACE);
     glCullFace(GL_BACK);
-
     glUseProgram(maResources.m_3DBatchProID);
     UpdateBatch3DUniformBlock();
     glBindBuffer(GL_UNIFORM_BUFFER, m_Batch3DUBOBuffer);
commit 4cde86a6e4648f49eb554cfaafcbf603c1a8a7c8
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed May 28 13:35:40 2014 +0800

    add batch render function

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 4b2f906..f16340d 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -230,6 +230,7 @@ private:
     void GetBatchMiddleInfo(Extrude3DInfo &extrude3D);
     void InitBatch3DUniformBlock();
     void UpdateBatch3DUniformBlock();
+    void RenderBatchBars();
 private:
 
     struct ShaderResources
diff --git a/chart2/source/view/inc/StaticGeometry.h b/chart2/source/view/inc/StaticGeometry.h
index 3ff412a..525b15b 100644
--- a/chart2/source/view/inc/StaticGeometry.h
+++ b/chart2/source/view/inc/StaticGeometry.h
@@ -12,9 +12,9 @@
 
 #define TOP_SURFACE 0
 #define MIDDLE_SURFACE 1
-#define BOTTOM_SURFACE 2
-#define FLAT_TOP_SURFACE 3
-#define FLAT_BOTTOM_SURFACE 4
+#define FLAT_BOTTOM_SURFACE 2
+#define BOTTOM_SURFACE 3
+#define FLAT_TOP_SURFACE 4
 
 static GLfloat boundBox[] = {
     0.0f, 0.0f, 0.0f,
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index e96b150..a031ab1 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -119,6 +119,9 @@ OpenGL3DRenderer::~OpenGL3DRenderer()
     glDeleteBuffers(1, &m_3DUBOBuffer);
     glDeleteBuffers(1, &m_VertexBuffer);
     glDeleteBuffers(1, &m_NormalBuffer);
+    glDeleteBuffers(1, &m_Batch3DUBOBuffer);
+    glDeleteBuffers(1, &m_3DUBOBuffer);
+    glDeleteBuffers(1, &m_3DUBOBuffer);
 
     glDeleteFramebuffers(1, &mnPickingFbo);
     glDeleteRenderbuffers(1, &mnPickingRboDepth);
@@ -146,6 +149,14 @@ OpenGL3DRenderer::ShaderResources::ShaderResources()
     , m_2DVertexID(0)
     , m_2DColorID(0)
     , m_MatrixID(0)
+    , m_3DBatchProID(0)
+    , m_3DBatchProjectionID(0)
+    , m_3DBatchViewID(0)
+    , m_3DBatchModelID(0)
+    , m_3DBatchNormalMatrixID(0)
+    , m_3DBatchVertexID(0)
+    , m_3DBatchNormalID(0)
+    , m_3DBatchColorID(0)
 {
 }
 
@@ -155,6 +166,7 @@ OpenGL3DRenderer::ShaderResources::~ShaderResources()
     glDeleteProgram(m_TextProID);
     glDeleteProgram(m_ScreenTextProID);
     glDeleteProgram(m_3DProID);
+    glDeleteProgram(m_3DBatchProID);
 }
 
 void OpenGL3DRenderer::ShaderResources::LoadShaders()
@@ -183,6 +195,14 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
     m_2DVertexID = glGetAttribLocation(m_CommonProID, "vPosition");
     m_2DColorID = glGetUniformLocation(m_CommonProID, "vColor");
 
+    m_3DBatchProID = OpenGLHelper::LoadShaders("shape3DVertexShaderBatch", "shape3DFragmentShaderBatch");
+    m_3DBatchProjectionID = glGetUniformLocation(m_3DBatchProID, "P");
+    m_3DBatchViewID = glGetUniformLocation(m_3DBatchProID, "V");
+    m_3DBatchModelID = glGetAttribLocation(m_3DBatchProID, "M");
+    m_3DBatchNormalMatrixID = glGetAttribLocation(m_3DBatchProID, "normalMatrix");
+    m_3DBatchVertexID = glGetAttribLocation(m_3DBatchProID, "vertexPositionModelspace");
+    m_3DBatchNormalID = glGetAttribLocation(m_3DBatchProID, "vertexNormalModelspace");
+    m_3DBatchColorID = glGetAttribLocation(m_3DBatchProID, "barColor");
     CHECK_GL_ERROR();
 }
 
@@ -243,6 +263,9 @@ void OpenGL3DRenderer::init()
     glGenBuffers(1, &m_CubeElementBuf);
     glGenBuffers(1, &m_VertexBuffer);
     glGenBuffers(1, &m_NormalBuffer);
+    glGenBuffers(1, &m_BatchModelMatrixBuf);
+    glGenBuffers(1, &m_BatchNormalMatrixBuf);
+    glGenBuffers(1, &m_BatchColorBuf);
     glGenBuffers(1, &m_BoundBox);
     glBindBuffer(GL_ARRAY_BUFFER, m_BoundBox);
     glBufferData(GL_ARRAY_BUFFER, sizeof(boundBox), boundBox, GL_STATIC_DRAW);
@@ -1028,6 +1051,7 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC
         m_Normals.clear();
         m_Indices.clear();
     }
+    m_Batchmaterial = m_Extrude3DInfo.material;
 }
 
 void OpenGL3DRenderer::EndAddShape3DExtrudeObject()
@@ -1679,7 +1703,8 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
     //Polygon
     RenderPolygon3DObject();
     //Shape3DExtrudeObject
-    RenderExtrude3DObject();
+    RenderBatchBars();
+//    RenderExtrude3DObject();
     //render text
     RenderTextShape();
     // render screen text
@@ -1839,6 +1864,113 @@ void OpenGL3DRenderer::GetBatchBarsInfo()
         }
     }
 }
+
+void OpenGL3DRenderer::RenderBatchBars()
+{
+    GetBatchBarsInfo();
+    glEnable(GL_DEPTH_TEST);
+    glEnable(GL_CULL_FACE);
+    glCullFace(GL_BACK);
+
+    glUseProgram(maResources.m_3DBatchProID);
+    UpdateBatch3DUniformBlock();
+    glBindBuffer(GL_UNIFORM_BUFFER, m_Batch3DUBOBuffer);
+    glBufferSubData(GL_UNIFORM_BUFFER, m_Batch3DActualSizeLight, sizeof(MaterialParameters), &m_Batchmaterial);
+    CHECK_GL_ERROR();
+    glBindBuffer(GL_UNIFORM_BUFFER, 0);
+    glUniformMatrix4fv(maResources.m_3DBatchViewID, 1, GL_FALSE, &m_3DView[0][0]);
+    glUniformMatrix4fv(maResources.m_3DBatchProjectionID, 1, GL_FALSE, &m_3DProjection[0][0]);
+    CHECK_GL_ERROR();
+    GLuint vertexBuf = m_Extrude3DInfo.rounded ? m_CubeVertexBuf : m_BoundBox;
+    GLuint normalBuf = m_Extrude3DInfo.rounded ? m_CubeNormalBuf : m_BoundBoxNormal;
+    //vertex
+    glEnableVertexAttribArray(maResources.m_3DBatchVertexID);
+    glBindBuffer(GL_ARRAY_BUFFER, vertexBuf);
+    glVertexAttribPointer(maResources.m_3DBatchVertexID, // attribute
+                          3,                  // size
+                          GL_FLOAT,           // type
+                          GL_FALSE,           // normalized?
+                          0,                  // stride
+                          (void*)0            // array buffer offset
+                          );
+    //normal
+    glEnableVertexAttribArray(maResources.m_3DBatchNormalID);
+    glBindBuffer(GL_ARRAY_BUFFER, normalBuf);
+    glVertexAttribPointer(maResources.m_3DBatchNormalID, // attribute
+                            3,                  // size
+                            GL_FLOAT,           // type
+                            GL_FALSE,           // normalized?
+                            0,                  // stride
+                            (void*)0            // array buffer offset
+                            );
+
+    for (unsigned int i = 0; i < 4 ; i++)
+    {
+        glEnableVertexAttribArray(maResources.m_3DBatchModelID + i);
+        glBindBuffer(GL_ARRAY_BUFFER, m_BatchModelMatrixBuf);
+        glVertexAttribPointer(maResources.m_3DBatchModelID + i, 4, GL_FLOAT, GL_FALSE, sizeof(glm::mat4), reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i * 4));
+        glVertexAttribDivisor(maResources.m_3DBatchModelID + i, 1);
+    }
+
+    for (unsigned int i = 0; i < 3 ; i++)
+    {
+        glEnableVertexAttribArray(maResources.m_3DBatchNormalMatrixID + i);
+        glBindBuffer(GL_ARRAY_BUFFER, m_BatchNormalMatrixBuf);
+        glVertexAttribPointer(maResources.m_3DBatchNormalMatrixID + i, 3, GL_FLOAT, GL_FALSE, sizeof(glm::mat3), reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i * 3));
+        glVertexAttribDivisor(maResources.m_3DBatchNormalMatrixID + i, 1);
+    }
+    glEnableVertexAttribArray(maResources.m_3DBatchColorID);
+    glBindBuffer(GL_ARRAY_BUFFER, m_BatchColorBuf);
+    glVertexAttribPointer(maResources.m_3DBatchColorID , 4, GL_FLOAT, GL_FALSE, sizeof(glm::vec4), 0);
+    glVertexAttribDivisor(maResources.m_3DBatchColorID, 1);
+    if (m_Extrude3DInfo.rounded)
+    {
+        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_CubeElementBuf);
+        for (int i = 0; i < 3; i++)
+        {
+            glBindBuffer(GL_ARRAY_BUFFER, m_BatchModelMatrixBuf);
+            glBufferData(GL_ARRAY_BUFFER, sizeof(glm::mat4) * m_BarSurface[i].modelMatrixList.size(), &m_BarSurface[i].modelMatrixList[0][0], GL_DYNAMIC_DRAW);
+            glBindBuffer(GL_ARRAY_BUFFER, m_BatchNormalMatrixBuf);
+            glBufferData(GL_ARRAY_BUFFER, sizeof(glm::mat3) * m_BarSurface[i].normalMatrixList.size(), &m_BarSurface[i].normalMatrixList[0][0], GL_DYNAMIC_DRAW);
+            glBindBuffer(GL_ARRAY_BUFFER, m_BatchColorBuf);
+            glBufferData(GL_ARRAY_BUFFER, sizeof(glm::vec4) * m_BarSurface[i].colorList.size(), &m_BarSurface[i].colorList[0], GL_DYNAMIC_DRAW);
+            glDrawElementsInstancedBaseVertex(GL_TRIANGLES,
+                                              m_Extrude3DInfo.size[i],
+                                              GL_UNSIGNED_SHORT,
+                                              reinterpret_cast<GLvoid*>(m_Extrude3DInfo.startIndex[i]),
+                                              m_BarSurface[i].modelMatrixList.size(),
+                                              0);
+        }
+    }
+    else
+    {
+        glBindBuffer(GL_ARRAY_BUFFER, m_BatchModelMatrixBuf);

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list