[Libreoffice-commits] core.git: Branch 'private/moggi/chart-opengl2' - 20 commits - chart2/inc chart2/Library_chartopengl.mk chart2/source include/svl sc/inc sc/source svl/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Dec 28 18:22:34 PST 2013
Rebased ref, commits from common ancestor:
commit fca1d65652e455dee8b3fcd163624ea74163b061
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Dec 29 05:17:28 2013 +0100
try to improve the rendering
Change-Id: I873e56c28228e24c9d26419a013f358548873931
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 261604c..4e4b3dc 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -953,7 +953,7 @@ void DummyChart::setSize( const awt::Size& aSize )
tempSize.Height = height;
mpWindow->SetSizePixel(Size(width, height));
pWindow->SetSizePixel(Size(width, height));
- DummyXShape::setSize(tempSize);
+ DummyXShape::setSize(Size(0,0));
m_GLRender.SetWidth(width);
m_GLRender.SetHeight(height);
SAL_WARN("chart2.opengl", "DummyChart::GLRender.Width = " << width << ", GLRender.Height = " << height);
commit 633170623a616b028c0ba010e0705d17ac8bb064
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Dec 29 05:16:17 2013 +0100
fix warnings
Change-Id: I3e45922aa6bc2bbd1db99025a5dde9670247501b
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index d4de633..c54ef8c 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -661,12 +661,12 @@ int OpenGLRender::RenderLine2FBO(int wholeFlag)
Bitmap::ScopedWriteAccess pAlphaWriteAccess( aAlpha );
size_t nCurPos = 0;
- for( size_t y = 0; y < m_iHeight; ++y)
+ for( size_t y = 0; y < size_t(m_iHeight); ++y)
{
Scanline pScan = pWriteAccess->GetScanline(y);
Scanline pAlphaScan = pAlphaWriteAccess->GetScanline(y);
- for( size_t x = 0; x < m_iWidth; ++x )
+ for( size_t x = 0; x < size_t(m_iWidth); ++x )
{
*pScan++ = buf[nCurPos];
*pScan++ = buf[nCurPos+1];
commit 06c2aec4804ba3ca4171f8df4bd2c4f7683ce360
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Dec 28 22:47:05 2013 +0000
WaE: signedness issue.
Change-Id: I91e20b0e107af3d5214d17c3bb04d22c9fce6cba
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index cec83fe..5852778 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -51,7 +51,7 @@ static double fTimes[DEBUG_TIME_MAX] = { 0.0, 0.0, 0.0 };
double datastream_get_time(int nIdx)
{
- if( nIdx < 0 || nIdx > SAL_N_ELEMENTS( fTimes ) )
+ if( nIdx < 0 || nIdx > (int)SAL_N_ELEMENTS( fTimes ) )
return -1;
return fTimes[ nIdx ];
}
commit 4247588a7c7c884f22c006ffd39e70915e9cbe56
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Dec 28 22:45:00 2013 +0000
implement datastream timings.
Change-Id: I8b3a1747ff291cbfcc650887bb8557fb5dc24c0d
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index aa07090..91f7116 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -25,6 +25,12 @@
using namespace com::sun::star;
+namespace sc
+{
+ // punch through into the datastream impl.
+ extern double datastream_get_time( int nIdx );
+}
+
// TODO: Add new methods for ScInterpreter here.
void ScInterpreter::ScFilterXML()
@@ -248,10 +254,15 @@ void ScInterpreter::ScDebugVar()
fVal = pDPs->GetCount();
}
PushDouble(fVal);
- return;
}
-
- PushIllegalParameter();
+ else if (aStrUpper == "DATASTREAM_IMPORT")
+ PushDouble( sc::datastream_get_time( 0 ) );
+ else if (aStrUpper == "DATASTREAM_RECALC")
+ PushDouble( sc::datastream_get_time( 1 ) );
+ else if (aStrUpper == "DATASTREAM_RENDER")
+ PushDouble( sc::datastream_get_time( 2 ) );
+ else
+ PushIllegalParameter();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index c7f52e5..cec83fe 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -38,6 +38,24 @@
namespace sc {
+extern double datastream_get_time(int nIdx);
+
+enum {
+ DEBUG_TIME_IMPORT,
+ DEBUG_TIME_RECALC,
+ DEBUG_TIME_RENDER,
+ DEBUG_TIME_MAX
+};
+
+static double fTimes[DEBUG_TIME_MAX] = { 0.0, 0.0, 0.0 };
+
+double datastream_get_time(int nIdx)
+{
+ if( nIdx < 0 || nIdx > SAL_N_ELEMENTS( fTimes ) )
+ return -1;
+ return fTimes[ nIdx ];
+}
+
inline double getNow()
{
TimeValue now;
@@ -353,10 +371,14 @@ void DataStream::Refresh()
{
Application::Yield();
+ double fStart = getNow();
+
// Hard recalc will repaint the grid area.
mpDocShell->DoHardRecalc(true);
mpDocShell->SetDocumentModified(true);
+ fTimes[ DEBUG_TIME_RECALC ] = getNow() - fStart;
+
mfLastRefreshTime = getNow();
mnLinesSinceRefresh = 0;
}
@@ -479,6 +501,8 @@ void DataStream::Text2Doc()
return;
}
+ double fStart = getNow();
+
MoveData();
{
StrValArray::const_iterator it = rStrs.begin(), itEnd = rStrs.end();
@@ -492,6 +516,8 @@ void DataStream::Text2Doc()
maDocAccess.setNumericCell(it->maPos, it->mfVal);
}
+ fTimes[ DEBUG_TIME_IMPORT ] = getNow() - fStart;
+
if (meMove == NO_MOVE)
return;
commit a7c23c4b965be1a3f90acd5c6233a027077defe8
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Dec 28 22:00:23 2013 +0000
don't create and destroy SvtMiscOptions here unless its needed.
Change-Id: I4b6e8136c56c824380c454272d9df4c646ec8e86
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index dcb676e..2d4c23c 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3442,11 +3442,10 @@ bool ScCompiler::NextNewToken( bool bInArray )
if ( cSymbol[0] < 128 )
{
bMayBeFuncName = rtl::isAsciiAlpha( cSymbol[0] );
- if (!bMayBeFuncName)
+ if (!bMayBeFuncName && (cSymbol[0] == '_' && cSymbol[1] == '_') )
{
SvtMiscOptions aOpt;
- if (aOpt.IsExperimentalMode())
- bMayBeFuncName = (cSymbol[0] == '_' && cSymbol[1] == '_');
+ bMayBeFuncName = aOpt.IsExperimentalMode();
}
bAsciiNonAlnum = !bMayBeFuncName && !rtl::isAsciiDigit( cSymbol[0] );
commit dd067e217dca402eef1e0c54f26b416b2c593946
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Dec 20 21:42:08 2013 -0500
We have these _xlfn. and _xlfnodf. internal prefixes. Check for __.
We don't want a name starting with a single underscore to be flagged
as function name. Let's do that only for double underscores.
Change-Id: If194a53e3f3ebf18a6e8ad38ebb16922f6e6083b
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 7b1ef50..dcb676e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -40,6 +40,7 @@
#include <tools/urlobj.hxx>
#include <rtl/math.hxx>
#include <rtl/ustring.hxx>
+#include <svtools/miscopt.hxx>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -3440,7 +3441,14 @@ bool ScCompiler::NextNewToken( bool bInArray )
bool bAsciiNonAlnum; // operators, separators, ...
if ( cSymbol[0] < 128 )
{
- bMayBeFuncName = rtl::isAsciiAlpha( cSymbol[0] ) || cSymbol[0] == '_';
+ bMayBeFuncName = rtl::isAsciiAlpha( cSymbol[0] );
+ if (!bMayBeFuncName)
+ {
+ SvtMiscOptions aOpt;
+ if (aOpt.IsExperimentalMode())
+ bMayBeFuncName = (cSymbol[0] == '_' && cSymbol[1] == '_');
+ }
+
bAsciiNonAlnum = !bMayBeFuncName && !rtl::isAsciiDigit( cSymbol[0] );
}
else
commit 8cc1593be59e6c10ebd3fb9b84595ae0347508b0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Dec 20 21:20:16 2013 -0500
Let's make it available in experimental mode only.
Change-Id: I023db5b98518296eb2964abe8c62f60d65d413a8
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 0bcf7ae..aa07090 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -9,6 +9,8 @@
#include "interpre.hxx"
#include <rtl/strbuf.hxx>
+#include <formula/errorcodes.hxx>
+#include <svtools/miscopt.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
@@ -213,6 +215,13 @@ void ScInterpreter::ScDebugVar()
// users. This is a convenient way to extract arbitrary internal state to
// a cell for easier debugging.
+ SvtMiscOptions aMiscOptions;
+ if (!aMiscOptions.IsExperimentalMode())
+ {
+ PushError(ScErrorCodes::errNoName);
+ return;
+ }
+
if (!MustHaveParamCount(GetByte(), 1))
{
PushIllegalParameter();
commit a0c3fe0c8c37fa5df3860afe1f8ef6f369ce4580
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Dec 23 23:46:02 2013 +0100
fix crash when erasing entry while iterating through vector
Broadcast might result in calling Remove on the same object which erases
the entry from the listeners vector. If we create a copy we can still
iterate through the vector as all iterators are still valid.
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 425a1e2..19abe38 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -124,7 +124,8 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint )
Normalize();
ListenersType::iterator dest(maDestructedListeners.begin());
- for (ListenersType::iterator it(maListeners.begin()); it != maListeners.end(); ++it)
+ ListenersType aListeners(maListeners); // this copy is important to avoid erasing entries while iterating
+ for (ListenersType::iterator it(aListeners.begin()); it != aListeners.end(); ++it)
{
// skip the destructed ones
while (dest != maDestructedListeners.end() && (*dest < *it))
commit 0c80a98738abe0dfb6e8599c6ac23bb1310d03a3
Author: Eike Rathke <erack at redhat.com>
Date: Mon Dec 23 13:04:15 2013 +0100
iterators are not pointers
Change-Id: Ic9809beead66cf0d0e6a6a28bb97b220fb667578
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 8d3905a..425a1e2 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -79,7 +79,7 @@ SvtBroadcaster::SvtBroadcaster( const SvtBroadcaster &rBC ) :
Normalize();
ListenersType::iterator dest(maDestructedListeners.begin());
- for (ListenersType::iterator it(maListeners.begin()); it < maListeners.end(); ++it)
+ for (ListenersType::iterator it(maListeners.begin()); it != maListeners.end(); ++it)
{
bool bStart = true;
@@ -108,7 +108,7 @@ SvtBroadcaster::~SvtBroadcaster()
// listeners, with the exception of those that already asked to be removed
// during their own destruction
ListenersType::iterator dest(maDestructedListeners.begin());
- for (ListenersType::iterator it(maListeners.begin()); it < maListeners.end(); ++it)
+ for (ListenersType::iterator it(maListeners.begin()); it != maListeners.end(); ++it)
{
// skip the destructed ones
while (dest != maDestructedListeners.end() && (*dest < *it))
@@ -124,7 +124,7 @@ void SvtBroadcaster::Broadcast( const SfxHint &rHint )
Normalize();
ListenersType::iterator dest(maDestructedListeners.begin());
- for (ListenersType::iterator it(maListeners.begin()); it < maListeners.end(); ++it)
+ for (ListenersType::iterator it(maListeners.begin()); it != maListeners.end(); ++it)
{
// skip the destructed ones
while (dest != maDestructedListeners.end() && (*dest < *it))
commit c2530c5381805b6c3da6a2d58a77af2f9a797568
Author: Jan Holesovsky <kendy at collabora.com>
Date: Sat Dec 21 20:51:29 2013 +0100
Make the broadcasting work even when about to destruct.
Change-Id: Idba9302e1ec5234d3d472cda047c09ba52afd328
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
index 72ac303..a77ebdb 100644
--- a/include/svl/broadcast.hxx
+++ b/include/svl/broadcast.hxx
@@ -82,6 +82,7 @@ private:
bool mbAboutToDie:1;
bool mbDisposing:1;
bool mbNormalized:1;
+ bool mbDestNormalized:1;
};
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 50d68a9..8d3905a 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -21,44 +21,23 @@
#include <svl/listener.hxx>
#include <svl/smplhint.hxx>
-namespace {
-
-class StartListeningHandler : std::unary_function<SvtListener*, void>
+void SvtBroadcaster::Normalize()
{
- SvtBroadcaster& mrBC;
-public:
- StartListeningHandler( SvtBroadcaster& rBC ) : mrBC(rBC) {}
-
- void operator() ( SvtListener* p )
+ if (!mbNormalized)
{
- p->StartListening(mrBC);
+ std::sort(maListeners.begin(), maListeners.end());
+ ListenersType::iterator itUniqueEnd = std::unique(maListeners.begin(), maListeners.end());
+ maListeners.erase(itUniqueEnd, maListeners.end());
+ mbNormalized = true;
}
-};
-
-class NotifyHandler : std::unary_function<SvtListener*, void>
-{
- SvtBroadcaster& mrBC;
- const SfxHint& mrHint;
-public:
- NotifyHandler( SvtBroadcaster& rBC, const SfxHint& rHint ) : mrBC(rBC), mrHint(rHint) {}
- void operator() ( SvtListener* p )
+ if (!mbDestNormalized)
{
- p->Notify(mrBC, mrHint);
+ std::sort(maDestructedListeners.begin(), maDestructedListeners.end());
+ ListenersType::iterator itUniqueEnd = std::unique(maDestructedListeners.begin(), maDestructedListeners.end());
+ maDestructedListeners.erase(itUniqueEnd, maDestructedListeners.end());
+ mbDestNormalized = true;
}
-};
-
-}
-
-void SvtBroadcaster::Normalize()
-{
- if (mbNormalized)
- return;
-
- std::sort(maListeners.begin(), maListeners.end());
- ListenersType::iterator itUniqueEnd = std::unique(maListeners.begin(), maListeners.end());
- maListeners.erase(itUniqueEnd, maListeners.end());
- mbNormalized = true;
}
void SvtBroadcaster::Add( SvtListener* p )
@@ -75,6 +54,7 @@ void SvtBroadcaster::Remove( SvtListener* p )
if (mbAboutToDie)
{
maDestructedListeners.push_back(p);
+ mbDestNormalized = false;
return;
}
@@ -88,12 +68,33 @@ void SvtBroadcaster::Remove( SvtListener* p )
ListenersGone();
}
-SvtBroadcaster::SvtBroadcaster() : mbAboutToDie(false), mbDisposing(false), mbNormalized(false) {}
+SvtBroadcaster::SvtBroadcaster() : mbAboutToDie(false), mbDisposing(false), mbNormalized(false), mbDestNormalized(false) {}
SvtBroadcaster::SvtBroadcaster( const SvtBroadcaster &rBC ) :
- maListeners(rBC.maListeners), mbAboutToDie(false), mbDisposing(false), mbNormalized(rBC.mbNormalized)
+ maListeners(rBC.maListeners), maDestructedListeners(rBC.maDestructedListeners),
+ mbAboutToDie(rBC.mbAboutToDie), mbDisposing(false),
+ mbNormalized(rBC.mbNormalized), mbDestNormalized(rBC.mbDestNormalized)
{
- std::for_each(maListeners.begin(), maListeners.end(), StartListeningHandler(*this));
+ if (mbAboutToDie)
+ Normalize();
+
+ ListenersType::iterator dest(maDestructedListeners.begin());
+ for (ListenersType::iterator it(maListeners.begin()); it < maListeners.end(); ++it)
+ {
+ bool bStart = true;
+
+ if (mbAboutToDie)
+ {
+ // skip the destructed ones
+ while (dest != maDestructedListeners.end() && (*dest < *it))
+ ++dest;
+
+ bStart = (dest == maDestructedListeners.end() || *dest != *it);
+ }
+
+ if (bStart)
+ (*it)->StartListening(*this);
+ }
}
SvtBroadcaster::~SvtBroadcaster()
@@ -101,12 +102,6 @@ SvtBroadcaster::~SvtBroadcaster()
mbDisposing = true;
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
- // normalize the list of listeners than already asked for destruction
- std::sort(maDestructedListeners.begin(), maDestructedListeners.end());
- ListenersType::iterator itUniqueEnd = std::unique(maDestructedListeners.begin(), maDestructedListeners.end());
- maDestructedListeners.erase(itUniqueEnd, maDestructedListeners.end());
-
- // and the list of registered listeners too
Normalize();
// now when both lists are sorted, we can linearly unregister all
@@ -126,12 +121,18 @@ SvtBroadcaster::~SvtBroadcaster()
void SvtBroadcaster::Broadcast( const SfxHint &rHint )
{
- if (mbAboutToDie)
- return;
-
Normalize();
- ListenersType listeners(maListeners);
- std::for_each(listeners.begin(), listeners.end(), NotifyHandler(*this, rHint));
+
+ ListenersType::iterator dest(maDestructedListeners.begin());
+ for (ListenersType::iterator it(maListeners.begin()); it < maListeners.end(); ++it)
+ {
+ // skip the destructed ones
+ while (dest != maDestructedListeners.end() && (*dest < *it))
+ ++dest;
+
+ if (dest == maDestructedListeners.end() || *dest != *it)
+ (*it)->Notify(*this, rHint);
+ }
}
void SvtBroadcaster::ListenersGone() {}
commit dd853ba910ee38ba3c68d2d58967f18ed809ace8
Author: Jan Holesovsky <kendy at collabora.com>
Date: Sat Dec 21 17:26:01 2013 +0100
Don't call EndListening() on already destructed listeners.
Change-Id: I9bda35f2246de9d37077dda33c710b89ee008e5a
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
index d122e02..72ac303 100644
--- a/include/svl/broadcast.hxx
+++ b/include/svl/broadcast.hxx
@@ -70,10 +70,15 @@ public:
* themselves from the broadcaster - the broadcaster will not broadcast
* anything after the PrepareForDesctruction() call anyway.
*/
- void PrepareForDestruction() { mbAboutToDie = true; }
+ void PrepareForDestruction();
private:
ListenersType maListeners;
+
+ /// When the broadcaster is about to die, collect listeners that asked for removal.
+ ListenersType maDestructedListeners;
+
+ /// Indicate that this broadcaster will be destructed (we indicate this on all ScColumn's broadcasters during the ScTable destruction, eg.)
bool mbAboutToDie:1;
bool mbDisposing:1;
bool mbNormalized:1;
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 3575c7f..50d68a9 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -35,18 +35,6 @@ public:
}
};
-class EndListeningHandler : std::unary_function<SvtListener*, void>
-{
- SvtBroadcaster& mrBC;
-public:
- EndListeningHandler( SvtBroadcaster& rBC ) : mrBC(rBC) {}
-
- void operator() ( SvtListener* p )
- {
- p->EndListening(mrBC);
- }
-};
-
class NotifyHandler : std::unary_function<SvtListener*, void>
{
SvtBroadcaster& mrBC;
@@ -81,9 +69,15 @@ void SvtBroadcaster::Add( SvtListener* p )
void SvtBroadcaster::Remove( SvtListener* p )
{
- if (mbAboutToDie || mbDisposing)
+ if (mbDisposing)
return;
+ if (mbAboutToDie)
+ {
+ maDestructedListeners.push_back(p);
+ return;
+ }
+
Normalize();
std::pair<ListenersType::iterator,ListenersType::iterator> r =
std::equal_range(maListeners.begin(), maListeners.end(), p);
@@ -107,8 +101,27 @@ SvtBroadcaster::~SvtBroadcaster()
mbDisposing = true;
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
- // unregister all listeners.
- std::for_each(maListeners.begin(), maListeners.end(), EndListeningHandler(*this));
+ // normalize the list of listeners than already asked for destruction
+ std::sort(maDestructedListeners.begin(), maDestructedListeners.end());
+ ListenersType::iterator itUniqueEnd = std::unique(maDestructedListeners.begin(), maDestructedListeners.end());
+ maDestructedListeners.erase(itUniqueEnd, maDestructedListeners.end());
+
+ // and the list of registered listeners too
+ Normalize();
+
+ // now when both lists are sorted, we can linearly unregister all
+ // listeners, with the exception of those that already asked to be removed
+ // during their own destruction
+ ListenersType::iterator dest(maDestructedListeners.begin());
+ for (ListenersType::iterator it(maListeners.begin()); it < maListeners.end(); ++it)
+ {
+ // skip the destructed ones
+ while (dest != maDestructedListeners.end() && (*dest < *it))
+ ++dest;
+
+ if (dest == maDestructedListeners.end() || *dest != *it)
+ (*it)->EndListening(*this);
+ }
}
void SvtBroadcaster::Broadcast( const SfxHint &rHint )
@@ -133,4 +146,10 @@ bool SvtBroadcaster::HasListeners() const
return !maListeners.empty();
}
+void SvtBroadcaster::PrepareForDestruction()
+{
+ mbAboutToDie = true;
+ maDestructedListeners.reserve(maListeners.size());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 5d96a8af9f1c90d7a9a5ff29a8294bc185e2aa9c
Author: Jan Holesovsky <kendy at collabora.com>
Date: Sat Dec 21 01:41:18 2013 +0100
Speedup destruction of sheets with too many listeners & broadcasters.
Listeners and broadcasters are M:N relationship. If you want to
destruct them, you easily end up in O(M*N) situation; where for every
listener, you iterate all broadcasters, to remove that one listener.
To avoid that, announce to the broadcasters that they are going to die, and the
listeners do not have to bother with removing themselves from the broadcaster.
The broadcaster will not broadcast anything after the PrepareForDesctruction()
call anyway.
Change-Id: I68d78b23e73bcbb944de9139448b2c20dfa14f62
diff --git a/include/svl/broadcast.hxx b/include/svl/broadcast.hxx
index 6a6bc03..d122e02 100644
--- a/include/svl/broadcast.hxx
+++ b/include/svl/broadcast.hxx
@@ -60,8 +60,21 @@ public:
bool HasListeners() const;
+ /**
+ * Listeners and broadcasters are M:N relationship. If you want to
+ * destruct them, you easily end up in O(M*N) situation; where for every
+ * listener, you iterate all broadcasters, to remove that one listener.
+ *
+ * To avoid that, use this call to announce to the broadcaster it is going
+ * to die, and the listeners do not have to bother with removing
+ * themselves from the broadcaster - the broadcaster will not broadcast
+ * anything after the PrepareForDesctruction() call anyway.
+ */
+ void PrepareForDestruction() { mbAboutToDie = true; }
+
private:
ListenersType maListeners;
+ bool mbAboutToDie:1;
bool mbDisposing:1;
bool mbNormalized:1;
};
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 55b3847..b7f48db 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -491,6 +491,7 @@ public:
SvtBroadcaster* GetBroadcaster( SCROW nRow );
const SvtBroadcaster* GetBroadcaster( SCROW nRow ) const;
void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2 );
+ void PrepareBroadcastersForDestruction();
bool HasBroadcaster() const;
void Broadcast( SCROW nRow );
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 307d42b..2092406b 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1962,6 +1962,21 @@ void ScColumn::DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, SCROW nRo
maBroadcasters.set_empty(rBlockPos.miBroadcasterPos, nRow1, nRow2);
}
+void ScColumn::PrepareBroadcastersForDestruction()
+{
+ sc::BroadcasterStoreType::iterator itPos = maBroadcasters.begin(), itPosEnd = maBroadcasters.end();
+ for (; itPos != itPosEnd; ++itPos)
+ {
+ if (itPos->type == sc::element_type_broadcaster)
+ {
+ sc::broadcaster_block::iterator it = sc::broadcaster_block::begin(*itPos->data);
+ sc::broadcaster_block::iterator itEnd = sc::broadcaster_block::end(*itPos->data);
+ for (; it != itEnd; ++it)
+ (*it)->PrepareForDestruction();
+ }
+ }
+}
+
bool ScColumn::HasBroadcaster() const
{
sc::BroadcasterStoreType::const_iterator it = maBroadcasters.begin(), itEnd = maBroadcasters.end();
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 4eed3b0..37417ac 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -341,6 +341,9 @@ ScTable::~ScTable()
delete mpRangeName;
delete pDBDataNoName;
DestroySortCollator();
+
+ for (SCCOL k=0; k<=MAXCOL; k++)
+ aCol[k].PrepareBroadcastersForDestruction();
}
void ScTable::GetName( OUString& rName ) const
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 24b5790..3575c7f 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -81,7 +81,7 @@ void SvtBroadcaster::Add( SvtListener* p )
void SvtBroadcaster::Remove( SvtListener* p )
{
- if (mbDisposing)
+ if (mbAboutToDie || mbDisposing)
return;
Normalize();
@@ -94,10 +94,10 @@ void SvtBroadcaster::Remove( SvtListener* p )
ListenersGone();
}
-SvtBroadcaster::SvtBroadcaster() : mbDisposing(false), mbNormalized(false) {}
+SvtBroadcaster::SvtBroadcaster() : mbAboutToDie(false), mbDisposing(false), mbNormalized(false) {}
SvtBroadcaster::SvtBroadcaster( const SvtBroadcaster &rBC ) :
- maListeners(rBC.maListeners), mbDisposing(false), mbNormalized(rBC.mbNormalized)
+ maListeners(rBC.maListeners), mbAboutToDie(false), mbDisposing(false), mbNormalized(rBC.mbNormalized)
{
std::for_each(maListeners.begin(), maListeners.end(), StartListeningHandler(*this));
}
@@ -113,6 +113,9 @@ SvtBroadcaster::~SvtBroadcaster()
void SvtBroadcaster::Broadcast( const SfxHint &rHint )
{
+ if (mbAboutToDie)
+ return;
+
Normalize();
ListenersType listeners(maListeners);
std::for_each(listeners.begin(), listeners.end(), NotifyHandler(*this, rHint));
commit ed62683f83b086f2f3bfeef6548b0546a031bf85
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Dec 28 13:27:41 2013 +0100
now I can at least something on the screen
Change-Id: Iececc07d84cd583b68231814353a357553eda604
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 0ec9feb..27b1ca1 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -126,6 +126,7 @@ uno::Reference< drawing::XShapes > OpenglShapeFactory::getOrCreateChartRootShape
xRet = new dummy::DummyChart();
m_pChart = (void *)((dummy::DummyChart *)xRet);
#endif
+ xDrawPage->add(xTarget);
xDrawPage->add(pContainer);
}
return xRet;
commit d67a7c60cdd07bc2b35f4b88e53c22e1552413fd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Dec 28 13:17:49 2013 +0100
try to control size
Change-Id: Ib588b28370bc7a680fa379d02d7669999e963bec
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 2ff2017..d4de633 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -683,6 +683,8 @@ int OpenGLRender::RenderLine2FBO(int wholeFlag)
uno::Reference< awt::XBitmap> xBmp( aGraphic.GetXGraphic(), uno::UNO_QUERY );
uno::Reference < beans::XPropertySet > xPropSet ( mxRenderTarget, uno::UNO_QUERY );
xPropSet->setPropertyValue("Graphic", uno::makeAny(aGraphic.GetXGraphic()));
+ mxRenderTarget->setSize(awt::Size(m_iWidth, m_iHeight));
+ mxRenderTarget->setPosition(awt::Point(0,0));
#endif
glBindFramebuffer(GL_FRAMEBUFFER, 0);
commit d417f6af35e59d250cc86fe43b1fc2066348aea6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Dec 28 07:21:34 2013 +0100
make it easier to draw with all properties
Change-Id: Ia563f703d5bc622f9577fee177b4f558c100be87
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx
index 2731d2d..80ef459 100644
--- a/chart2/inc/ChartView.hxx
+++ b/chart2/inc/ChartView.hxx
@@ -202,6 +202,8 @@ private: //member
m_xShapeFactory;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>
m_xDrawPage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
+ mxRootShape;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDashTable;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xGradientTable;
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index e9726c2..b0bf8f4 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -236,6 +236,11 @@ public:
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize ) = 0;
+ /**
+ * Only necessary for stateless implementations
+ */
+ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0;
+
virtual void createSeries( const com::sun::star::uno::Reference<
com::sun::star::drawing::XShapes> & xTarget,
diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index e68c5b8..915b5aa 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -174,7 +174,13 @@ public:
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ // normal non UNO methods
+
virtual DummyChart* getRootShape();
+ /**
+ * Implement this method for all subclasses that should be rendered
+ */
+ virtual void render();
protected:
@@ -393,6 +399,9 @@ public:
virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException) ;
virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // normal methods
+ virtual void render();
+
private:
std::vector<com::sun::star::uno::Reference< com::sun::star::drawing::XShape > > maUNOShapes;
std::vector<DummyXShape*> maShapes;
diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index be4d01d..f4f6160 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -190,6 +190,8 @@ public:
::com::sun::star::drawing::XDrawPage>& xPage );
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize );
+
+ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) SAL_OVERRIDE;
private:
void *m_pChart;
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index c23e13e..614b13f 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -205,6 +205,11 @@ public:
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize );
+ /**
+ * not necessary right now
+ */
+ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
+
private:
ShapeFactory();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index f501aa9..9a2a949 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2390,8 +2390,8 @@ void ChartView::createShapes()
awt::Size aPageSize = mrChartModel.getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory);
- uno::Reference<drawing::XShapes> xPageShapes(
- pShapeFactory->getOrCreateChartRootShape( m_xDrawPage ) );
+ if(!mxRootShape.is())
+ mxRootShape = pShapeFactory->getOrCreateChartRootShape( m_xDrawPage );
SdrPage* pPage = ChartView::getSdrPage();
if(pPage) //it is necessary to use the implementation here as the uno page does not provide a propertyset
@@ -2400,14 +2400,14 @@ void ChartView::createShapes()
{
OSL_FAIL("could not set page size correctly");
}
- pShapeFactory->setPageSize(xPageShapes, aPageSize);
+ pShapeFactory->setPageSize(mxRootShape, aPageSize);
{
SolarMutexGuard aSolarGuard;
// todo: it would be nicer to just pass the page m_xDrawPage and format it,
// but the draw page does not support XPropertySet
- formatPage( mrChartModel, aPageSize, xPageShapes, m_xShapeFactory );
+ formatPage( mrChartModel, aPageSize, mxRootShape, m_xShapeFactory );
//sal_Int32 nYDistance = static_cast<sal_Int32>(aPageSize.Height*lcl_getPageLayoutDistancePercentage());
awt::Rectangle aRemainingSpace( 0, 0, aPageSize.Width, aPageSize.Height );
@@ -2416,7 +2416,7 @@ void ChartView::createShapes()
uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
OUString aDiagramCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) ) );//todo: other index if more than one diagram is possible
uno::Reference< drawing::XShapes > xDiagramPlusAxesPlusMarkHandlesGroup_Shapes(
- pShapeFactory->createGroup2D(xPageShapes,aDiagramCID) );
+ pShapeFactory->createGroup2D(mxRootShape,aDiagramCID) );
uno::Reference< drawing::XShape > xDiagram_MarkHandles( pShapeFactory->createInvisibleRectangle(
xDiagramPlusAxesPlusMarkHandlesGroup_Shapes, awt::Size(0,0) ) );
@@ -2430,12 +2430,12 @@ void ChartView::createShapes()
bool bAutoPositionDummy = true;
- lcl_createTitle( TitleHelper::MAIN_TITLE, xPageShapes, m_xShapeFactory, mrChartModel
+ lcl_createTitle( TitleHelper::MAIN_TITLE, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, ALIGN_TOP, bAutoPositionDummy );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
- lcl_createTitle( TitleHelper::SUB_TITLE, xPageShapes, m_xShapeFactory, mrChartModel
+ lcl_createTitle( TitleHelper::SUB_TITLE, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, ALIGN_TOP, bAutoPositionDummy );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
@@ -2443,7 +2443,7 @@ void ChartView::createShapes()
SeriesPlotterContainer aSeriesPlotterContainer( m_aVCooSysList );
aSeriesPlotterContainer.initializeCooSysAndSeriesPlotter( mrChartModel );
- lcl_createLegend( LegendHelper::getLegend( mrChartModel ), xPageShapes, m_xShapeFactory, m_xCC
+ lcl_createLegend( LegendHelper::getLegend( mrChartModel ), mxRootShape, m_xShapeFactory, m_xCC
, aRemainingSpace, aPageSize, mrChartModel, aSeriesPlotterContainer.getLegendEntryProviderList()
, lcl_getDefaultWritingModeFromPool( m_pDrawModelWrapper ) );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
@@ -2455,7 +2455,7 @@ void ChartView::createShapes()
bool bAutoPosition_XTitle = true;
boost::shared_ptr<VTitle> apVTitle_X;
if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 0 ) )
- apVTitle_X = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, xPageShapes, m_xShapeFactory, mrChartModel
+ apVTitle_X = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, ALIGN_BOTTOM, bAutoPosition_XTitle );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
@@ -2463,7 +2463,7 @@ void ChartView::createShapes()
bool bAutoPosition_YTitle = true;
boost::shared_ptr<VTitle> apVTitle_Y;
if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 1 ) )
- apVTitle_Y = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, xPageShapes, m_xShapeFactory, mrChartModel
+ apVTitle_Y = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, ALIGN_LEFT, bAutoPosition_YTitle );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
@@ -2471,7 +2471,7 @@ void ChartView::createShapes()
bool bAutoPosition_ZTitle = true;
boost::shared_ptr<VTitle> apVTitle_Z;
if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 2 ) )
- apVTitle_Z = lcl_createTitle( TitleHelper::Z_AXIS_TITLE, xPageShapes, m_xShapeFactory, mrChartModel
+ apVTitle_Z = lcl_createTitle( TitleHelper::Z_AXIS_TITLE, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, ALIGN_RIGHT, bAutoPosition_ZTitle );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
@@ -2482,7 +2482,7 @@ void ChartView::createShapes()
bool bAutoPosition_SecondXTitle = true;
boost::shared_ptr<VTitle> apVTitle_SecondX;
if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension, 0 ) )
- apVTitle_SecondX = lcl_createTitle( TitleHelper::SECONDARY_X_AXIS_TITLE, xPageShapes, m_xShapeFactory, mrChartModel
+ apVTitle_SecondX = lcl_createTitle( TitleHelper::SECONDARY_X_AXIS_TITLE, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, bIsVertical? ALIGN_RIGHT : ALIGN_TOP, bAutoPosition_SecondXTitle );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
@@ -2490,7 +2490,7 @@ void ChartView::createShapes()
bool bAutoPosition_SecondYTitle = true;
boost::shared_ptr<VTitle> apVTitle_SecondY;
if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension, 1 ) )
- apVTitle_SecondY = lcl_createTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, xPageShapes, m_xShapeFactory, mrChartModel
+ apVTitle_SecondY = lcl_createTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, mxRootShape, m_xShapeFactory, mrChartModel
, aRemainingSpace, aPageSize, bIsVertical? ALIGN_TOP : ALIGN_RIGHT, bAutoPosition_SecondYTitle );
if(aRemainingSpace.Width<=0||aRemainingSpace.Height<=0)
return;
@@ -2526,7 +2526,7 @@ void ChartView::createShapes()
}
//cleanup: remove all empty group shapes to avoid grey border lines:
- lcl_removeEmptyGroupShapes( xPageShapes );
+ lcl_removeEmptyGroupShapes( mxRootShape );
}
// #i12587# support for shapes in chart
@@ -2536,6 +2536,8 @@ void ChartView::createShapes()
m_pDrawModelWrapper->getSdrModel().EnableUndo( true );
}
+ pShapeFactory->render( mxRootShape );
+
#if OSL_DEBUG_LEVEL > 0
clock_t nEnd = clock();
double fDuration =(double(nEnd-nStart)*1000.0)/double(CLOCKS_PER_SEC);
@@ -2940,15 +2942,16 @@ uno::Sequence< OUString > ChartView::getAvailableServiceNames() throw (uno::Runt
OUString ChartView::dump() throw (uno::RuntimeException)
{
impl_updateView();
- uno::Reference<drawing::XShapes> xPageShapes( AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory)
- ->getOrCreateChartRootShape( m_xDrawPage ) );
+ if(!mxRootShape.is())
+ mxRootShape = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory)
+ ->getOrCreateChartRootShape( m_xDrawPage );
- if (!xPageShapes.is())
+ if (!mxRootShape.is())
return OUString();
else
{
XShapeDumper dumper;
- return dumper.dump(xPageShapes);
+ return dumper.dump(mxRootShape);
}
}
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 2601a38..261604c 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -219,6 +219,11 @@ void DummyXShape::setParent( const uno::Reference< uno::XInterface >& xParent )
mxParent = xParent;
}
+void DummyXShape::render()
+{
+ SAL_WARN("chart2.opengl", "maybe a missing implementation in a subclass?");
+}
+
namespace {
void setProperties( uno::Reference< beans::XPropertySet > xPropSet, const tPropertyNameMap& rPropertyNameMap,
@@ -542,6 +547,15 @@ uno::Any DummyXShapes::getByIndex(sal_Int32 nIndex)
return aShape;
}
+void DummyXShapes::render()
+{
+ for(std::vector<DummyXShape*>::iterator itr = maShapes.begin(),
+ itrEnd = maShapes.end(); itr != itrEnd; ++itr)
+ {
+ (*itr)->render();
+ }
+}
+
bool DummyChart::initWindow()
{
const SystemEnvData* sysData(mpWindow->GetSystemData());
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 70bc1b5..0ec9feb 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -529,6 +529,13 @@ void OpenglShapeFactory::renderSeries( const uno::Reference<
SAL_WARN("chart2.opengl", "OpenglShapeFactory::renderSeries()-----test:");
}
+void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape)
+{
+ dummy::DummyChart* pChart = dynamic_cast<dummy::DummyChart*>(xRootShape.get());
+ assert(pChart);
+ pChart->render();
+}
+
} //namespace dummy
} //namespace chart
commit d1c492db329e324c6c158cfcc786069c3c6c5efc
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Dec 27 21:19:59 2013 +0100
also set line properties to the internal properties
Change-Id: I385fc04853d2da33c2ee6c81833289f75c4176bb
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 7e09cbc..2601a38 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -22,6 +22,7 @@
#include <vcl/window.hxx>
#include <tools/gen.hxx>
+#include <editeng/unoprnms.hxx>
#include <algorithm>
@@ -348,14 +349,49 @@ DummyCircle::DummyCircle(const awt::Point& rPos, const awt::Size& rSize)
setSize(rSize);
}
-DummyLine3D::DummyLine3D(const drawing::PolyPolygonShape3D& rPoints, const VLineProperties& ):
+namespace {
+
+void setProperties( const VLineProperties& rLineProperties, std::map<OUString, uno::Any>& rTargetProps )
+{
+ //Transparency
+ if(rLineProperties.Transparence.hasValue())
+ rTargetProps.insert(std::pair<OUString, uno::Any>(
+ UNO_NAME_LINETRANSPARENCE, rLineProperties.Transparence));
+
+ //LineStyle
+ if(rLineProperties.LineStyle.hasValue())
+ rTargetProps.insert(std::pair<OUString, uno::Any>(
+ UNO_NAME_LINESTYLE, rLineProperties.LineStyle));
+
+ //LineWidth
+ if(rLineProperties.Width.hasValue())
+ rTargetProps.insert(std::pair<OUString, uno::Any>(
+ UNO_NAME_LINEWIDTH, rLineProperties.Width));
+
+ //LineColor
+ if(rLineProperties.Color.hasValue())
+ rTargetProps.insert(std::pair<OUString, uno::Any>(
+ UNO_NAME_LINECOLOR, rLineProperties.Transparence));
+
+ //LineDashName
+ if(rLineProperties.DashName.hasValue())
+ rTargetProps.insert(std::pair<OUString, uno::Any>(
+ "LineDashName", rLineProperties.DashName));
+}
+
+}
+
+DummyLine3D::DummyLine3D(const drawing::PolyPolygonShape3D& rPoints, const VLineProperties& rLineProperties):
maPoints(rPoints)
{
+ setProperties(rLineProperties, maProperties);
}
-DummyLine2D::DummyLine2D(const drawing::PointSequenceSequence& rPoints, const VLineProperties* ):
+DummyLine2D::DummyLine2D(const drawing::PointSequenceSequence& rPoints, const VLineProperties* pLineProperties):
maPoints(rPoints)
{
+ if(pLineProperties)
+ setProperties(*pLineProperties, maProperties);
}
DummyLine2D::DummyLine2D(const awt::Size& rSize, const awt::Point& rPosition)
commit b082e7306a2973b394a48ddece2e07778b94f886
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Dec 27 21:09:49 2013 +0100
set a few more missed properties
Change-Id: I30a606e2bea9c8c8d7861e5b05a6df0e7c00b9a5
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 972f02f..7e09cbc 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -235,6 +235,16 @@ void setProperties( uno::Reference< beans::XPropertySet > xPropSet, const tPrope
}
}
+void setProperties( const tNameSequence& rNames, const tAnySequence& rValues,
+ std::map<OUString, uno::Any>& rTargetMap)
+{
+ sal_Int32 nSize = std::min(rNames.getLength(), rValues.getLength());
+ for(sal_Int32 i = 0; i < nSize; ++i)
+ {
+ rTargetMap[rNames[i]] = rValues[i];
+ }
+}
+
}
DummyCube::DummyCube(const drawing::Position3D &rPos, const drawing::Direction3D& rSize,
@@ -363,18 +373,20 @@ DummyRectangle::DummyRectangle(const awt::Size& rSize)
setSize(rSize);
}
-DummyRectangle::DummyRectangle(const awt::Size& rSize, const awt::Point& rPoint, const tNameSequence& ,
- const tAnySequence& )
+DummyRectangle::DummyRectangle(const awt::Size& rSize, const awt::Point& rPoint, const tNameSequence& rNames,
+ const tAnySequence& rValues)
{
setSize(rSize);
setPosition(rPoint);
+ setProperties(rNames, rValues, maProperties);
}
-DummyText::DummyText(const OUString& rText, const tNameSequence& ,
- const tAnySequence& , const uno::Any& rTrans ):
+DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
+ const tAnySequence& rValues, const uno::Any& rTrans ):
maText(rText),
maTrans(rTrans)
{
+ setProperties(rNames, rValues, maProperties);
}
DummyGroup3D::DummyGroup3D(const OUString& rName)
commit b51692a2666a1afeaa9d56041a0d415e2ba6484c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Dec 27 21:01:55 2013 +0100
enable that code again
Change-Id: I4314c7062195f0593c34b6a11ba2b3ae81811ff8
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 7372a44..972f02f 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -220,10 +220,9 @@ void DummyXShape::setParent( const uno::Reference< uno::XInterface >& xParent )
namespace {
-void setProperties( uno::Reference< beans::XPropertySet > , const tPropertyNameMap& ,
- std::map<OUString, uno::Any>& )
+void setProperties( uno::Reference< beans::XPropertySet > xPropSet, const tPropertyNameMap& rPropertyNameMap,
+ std::map<OUString, uno::Any>& rTargetMap)
{
-/*
tNameSequence aNames;
tAnySequence aValues;
PropertyMapper::getMultiPropertyLists( aNames, aValues,
@@ -234,7 +233,6 @@ void setProperties( uno::Reference< beans::XPropertySet > , const tPropertyNameM
{
rTargetMap[aNames[i]] = aValues[i];
}
-*/
}
}
commit 25158c98a003318ed7d52bf3478a095045f81944
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Dec 24 04:50:42 2013 +0100
fix regression from last warning cleaning
Change-Id: Id4f758a6d27670ff03d4e0c32a45ca66cc74d0c6
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 92489c3..2ff2017 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -654,19 +654,19 @@ int OpenGLRender::RenderLine2FBO(int wholeFlag)
BitmapEx aBmp;
aBmp.SetSizePixel(Size(m_iWidth, m_iHeight));
- Bitmap aBitmap( aBmp.GetBitmap() );
- Bitmap aAlpha( aBmp.GetAlpha().GetBitmap() );
+ Bitmap aBitmap( Size( m_iWidth, m_iHeight), 24 );
+ Bitmap aAlpha( Size( m_iWidth, m_iHeight), 24 );
Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
Bitmap::ScopedWriteAccess pAlphaWriteAccess( aAlpha );
size_t nCurPos = 0;
- for( int y = 0; y < m_iHeight; ++y)
+ for( size_t y = 0; y < m_iHeight; ++y)
{
Scanline pScan = pWriteAccess->GetScanline(y);
Scanline pAlphaScan = pAlphaWriteAccess->GetScanline(y);
- for( int x = 0; x < m_iWidth; ++x )
+ for( size_t x = 0; x < m_iWidth; ++x )
{
*pScan++ = buf[nCurPos];
*pScan++ = buf[nCurPos+1];
commit ddd174dd1b0cb0b27580bf335ade1ebf76ae7287
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Dec 24 04:37:42 2013 +0100
blind fix for reported Windows build error
Change-Id: Ia106f5b1ec5177099c098390ece7fda1a478078c
diff --git a/chart2/Library_chartopengl.mk b/chart2/Library_chartopengl.mk
index 2532fc3..aa4a77e 100644
--- a/chart2/Library_chartopengl.mk
+++ b/chart2/Library_chartopengl.mk
@@ -31,11 +31,23 @@ $(eval $(call gb_Library_use_externals,chartopengl,\
))
$(eval $(call gb_Library_use_libraries,chartopengl,\
+ basegfx \
chartcore \
+ comphelper \
cppu \
cppuhelper \
+ drawinglayer \
+ editeng \
+ fwe \
+ i18nlangtag \
sal \
- svxcore \
+ sfx \
+ svl \
+ svt \
+ svxcore \
+ tl \
+ ucbhelper \
+ utl \
vcl \
$(gb_UWINAPI) \
))
More information about the Libreoffice-commits
mailing list